|
|
|
|
|
- Number of columns: Taking empty columns into account
xlsNbColumn (Function) In french: xlsNbColonne Returns the number of columns found in a worksheet of an XLS file. The result depends on the opening mode of XLS file: - In multi-sheet mode, the number of columns is calculated for the worksheet selected by xlsCurrentWorksheet.
- In compatible mode, the number of columns is always calculated for the first worksheet of the workbook.
This function assumes that the XLS file has a database structure, which means that each row corresponds to a fixed number of columns. Note: The number of columns in an XLS file can only be retrieved if: - The XLS file exists.
- The XLS file is opened.
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
ResNbColumns = xlsNbColumn(XLSFileID)
...
END
Syntax
Syntax that uses the xlsDocument type Hide the details
<Result> = xlsNbColumn(<XLS document> [, <Empty columns>])
<Result>: Integer - Number of columns in the specified XLS file
- -1 if an error occurred (XLS file not opened for example). To get more details on the error, use xlsMsgError or ErrorInfo with the errMessage constant.
<XLS document>: xlsDocument variable Name of the xlsDocument variable corresponding to the XLS file to use. <Empty columns>: Optional boolean Mode for taking the empty columns into account: | | False | The columns that are entirely empty are taken into account | True (by default) | The columns that are entirely empty are ignored. |
Syntax kept for backward compatibility with version 12 Hide the details
<Result> = xlsNbColumn(<XLS file identifier> [, <Empty columns>])
<Result>: Integer - Number of columns in the specified XLS file,
- -1 if an error occurred (XLS file not opened for example). To get more details on the error, use xlsMsgError or ErrorInfo with the errMessage constant.
<XLS file identifier>: Integer Identifier of the XLS file to handle, returned by xlsOpen. <Empty columns>: Optional boolean Mode for taking the empty columns into account: | | False | The columns that are entirely empty are taken into account | True (by default) | The columns that are entirely empty are ignored |
Remarks Number of columns: Taking empty columns into account You can choose to take empty columns into account. For example:
xlsNbColumn(XLSFileID, True)
xlsNbColumn(XLSFileID, False)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|