- 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
This page is also available for…
|
|
|
|