ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XLS file functions
  • Number of rows: Taking empty rows into account
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the number of rows found in an XLS file. The result depends on the opening mode of XLS file:
  • In multi-sheet mode, the number of rows is calculated for the worksheet selected by xlsCurrentWorksheet.
  • In compatible mode, the number of rows is always calculated for the first worksheet of the workbook.
Note: The number of rows in an XLS file can only be retrieved if:
  • The XLS file exists.
  • The XLS file is opened.
New in version 2025
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
	// Number of rows
	ResNbRows = xlsNbRow(XLSFileID)
	...
END
Syntax

Syntax that uses the xlsDocument type Hide the details

<Result> = xlsNbRow(<XLS document> [, <Empty rows>])
<Result>: Integer
  • Number of rows found in the specified XLS file,
  • -1 if an error occurred (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 rows>: Optional boolean
Defines how the empty rows will be taken into account:
FalseThe rows that are entirely empty are taken into account.
True
(by default)
The rows that are entirely empty are ignored.

Syntax kept for backward compatibility with version 12 Hide the details

<Result> = xlsNbRow(<XLS file identifier> [, <Empty rows>])
<Result>: Integer
  • Number of rows found in the specified XLS file,
  • -1 if an error occurred (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 rows>: Optional boolean
Defines how the empty rows will be taken into account:
FalseThe rows that are entirely empty are taken into account.
True
(by default)
The rows that are entirely empty are ignored.
Remarks

Number of rows: Taking empty rows into account

The empty rows can be taken into account or not. For example:
xlsNbRow(XLSFileID, True) // Returns "6"
xlsNbRow(XLSFileID, False) // Returns "7"
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