ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XLS file functions
  • Type of data entered in a column: Empty columns
  • Handling errors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
	// Type of data entered
	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
xlsTypeEmptyColumn entirely empty if <Empty columns> = False
xlsTypeErrorIf 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:
FalseAll 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
xlsTypeEmptyColumn entirely empty if <Empty columns> = False
xlsTypeErrorIf 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:
FalseAll 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) // Returns xlsTypeString
xlsColumnType(XLSFileID, 2, False) // Returns xlsTypeEmpty

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.
Component: wd300xls.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/20/2024

Send a report | Local help