|
|
|
|
|
- Type of data entered in a column: Empty columns
- Handling errors
xlsColumnType (Function) In french: xlsTypeColonne Returns the type of data entered in a column of an XLS file. The result depends on the opening mode of XLS file: - In multi-sheet mode, the column used is found on the worksheet selected by xlsCurrentWorksheet.
- In compatible mode, the column used is always found on the first worksheet of the workbook.
Note: The type of data entered in a column of an XLS file can only be returned if: - The XLS file exists.
- The XLS file is opened.
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
ResColumnTitle = xlsColumnType(XLSFileID, 4)
SWITCH ResColumnTitle
CASE xlsTypeString: Info("String data")
CASE xlsTypeDate: Info("Date data")
CASE xlsTypeDouble: Info("Numeric data")
CASE xlsTypeTime: Info("Time data")
CASE xlsTypeDateTime: Info("DateTime data")
CASE xlsTypeDuration: Info("Duration data")
CASE xlsTypeCurrency: Info("Currency data")
END
...
END
Syntax
Syntax that uses the xlsDocument type Hide the details
<Result> = xlsColumnType(<XLS document> , <Column number> [, <Empty columns>])
<Result>: Integer constant Type of data entered in the specified column: | | xlsTypeCurrency | "Currency" column | xlsTypeDate | "Date" column | xlsTypeDateTime | "DateTime" column | xlsTypeDouble | "Numeric" column | xlsTypeDuration | "Duration" column | xlsTypeEmpty | Column entirely empty if <Empty columns> = False | xlsTypeError | If an error occurs. To get more details on the error, use xlsMsgError or ErrorInfo with the errMessage constant. | xlsTypeString | "Character string" column or column containing different types of data | xlsTypeTime | "Time" column |
<XLS document>: xlsDocument variable Name of the xlsDocument variable corresponding to the XLS file to use. <Column number>: Integer Number of the column to read. <Empty columns>: Optional boolean Mode for taking the empty columns into account: | | False | All empty columns are taken into account | True (by default) | All empty columns are ignored |
Syntax kept for backward compatibility with version 12 Hide the details
<Result> = xlsColumnType(<XLS file identifier> , <Column number> [, <Empty columns>])
<Result>: Integer constant Type of data entered in the specified column: | | xlsTypeCurrency | "Currency" column | xlsTypeDate | "Date" column | xlsTypeDateTime | "DateTime" column | xlsTypeDouble | "Numeric" column | xlsTypeDuration | "Duration" column | xlsTypeEmpty | Column entirely empty if <Empty columns> = False | xlsTypeError | If an error occurs. To get more details on the error, use xlsMsgError or ErrorInfo with the errMessage constant. | xlsTypeString | "Character string" column or column containing different types of data | xlsTypeTime | "Time" column |
<XLS file identifier>: Integer Identifier of the XLS file to handle, returned by xlsOpen. <Column number>: Integer Number of the column to read. <Empty columns>: Optional boolean Mode for taking the empty columns into account: | | False | All empty columns are taken into account | True (by default) | All empty columns are ignored |
Remarks Type of data entered in a column: Empty columns You can choose whether or not to take empty columns into account. For example:
xlsColumnType(XLSFileID, 2, True)
xlsColumnType(XLSFileID, 2, False)
Handling errors xlsColumnType throws an error in the following cases: - The specified column is not found (negative column for example).
- The specified XLS file is not opened.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|