|
|
|
|
|
- Number of columns in an XLS file
Number of columns in an XLS file The following code returns the number of columns in an XLS file. The columns that are entirely empty are not taken into account ( True). This file was opened by xlsOpen. // Declare the variables XLSFileID is int ResNbColumns is int // Open an XLS file XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS") IF XLSFileID <> -1 THEN // Number of columns ResNbColumns = xlsNbColumn(XLSFileID, True) IF ResNbColumns <> -1 THEN  IF ResNbColumns = 0 THEN  // There is no column  Info("The XLS file contains no column")  ELSE  // Display the number of columns  Info("The file contains: " + ResNbColumns + ... "columns")  END ELSE // Display the error message Error(xlsMsgError(XLSFileID)) END ELSE // Display an error message if the opening was not performed  Error(xlsMsgError(XLSFileID)) END // Close the XLS file xlsClose(XLSFileID)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|