ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XLS file functions
  • Column caption
  • Handling errors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
xlsColumnTitle (Function)
In french: xlsTitreColonne
Retrieves the title of a column found in an XLS file. The result depends on the opening mode of XLS file:
  • In multi-sheet mode, the column title is sought for the worksheet selected by xlsCurrentWorksheet.
  • In compatible mode, the column title is always sought for the first worksheet of workbook.
Note: The column title of an XLS file can only be retrieved if:
  • The XLS file exists.
  • The XLS file is opened.
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
	// Retrieve the caption of a column
	ResColumnTitle = xlsColumnTitle(XLSFileID, 4)
	...
END
Syntax

Syntax that uses the xlsDocument type Hide the details

<Result> = xlsColumnTitle(<XLS document> , <Column number> [, <Empty columns>])
<Result>: Character string
  • Caption of specified column,
  • xlsTitleError constant if an error occurred. 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.
<Column number>: Integer
Number of the column to read.
<Empty columns>: Optional boolean
Mode for taking the empty columns into account:
FalseThe 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> = xlsColumnTitle(<XLS file identifier> , <Column number> [, <Empty columns>])
<Result>: Character string
  • Caption of specified column,
  • xlsTitleError constant if an error occurred. 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.
<Column number>: Integer
Number of the column to read.
<Empty columns>: Optional boolean
Mode for taking the empty columns into account:
FalseThe columns that are entirely empty are taken into account
True
(by default)
The columns that are entirely empty are ignored
Remarks

Column caption

The empty columns can be taken into account or not. For example:
xlsColumnTitle(XLSFileID, 3, True) // Returns "Age"
xlsColumnTitle(XLSFileID, 3, False) // Returns ""

Handling errors

xlsColumnTitle 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