ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XLS file functions
  • Retrieving the content of a cell found in an XLS file
Retrieving the content of a cell found in an XLS file
The following code is used to retrieve the content of a cell found in an XLS file. The empty rows and columns are taken into account (False). The XLS file is selected with fSelect.
// Declare the variables
ResData is string
XLSFile is string
XLSFileID is int
 
// Select the XLS file
XLSFile = fSelect("", "", "Selecting an XLS file", ...
"XLS file" + TAB + "*.XLS", "XLS", fselOpen + fselExist)
// Open the selected file
XLSFileID = xlsOpen(XLSFile)
IF XLSFileID <> -1 THEN
// Retrieve the content of a cell
ResData = xlsData(XLSFileID, 3, 4, False)
IF ResData = "" THEN
IF ErrorOccurred = True THEN
// Display an error message if the retrieval was not performed
Error(xlsMsgError(XLSFileID))
ELSE
// The cell is empty
Info("The cell is empty")
END
ELSE
// Display the content of the cell
Info("The content of the cell is: " + ResData)
END
ELSE
// Display an error message if the opening was not performed
Error(xlsMsgError(XLSFileID))
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help