|
|
|
|
- Returning the last error that occurred on an XLS file
- Returning the last error that occurred on an XLS file
Returning the last error that occurred on an XLS file Returning the last error that occurred on an XLS file The following code returns an error message if xlsOpen and xlsData threw an error.
// Declare the variables ResData is string XLSFileID is int // Open an XLS file XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS") IF XLSFileID <> -1 THEN // Retrieve the content of a cell ResData = xlsData(XLSFileID, 3, 4) IF ResData = "" THEN IF xlsMsgError(XLSFileID) = "" THEN // The cell is empty Info("The cell is empty") ELSE // Display an error message if the retrieval was not performed Error(xlsMsgError(XLSFileID)) // Identical to: Error(ErrorInfo(errMessage)) 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)) // Identical to: Error(ErrorInfo(errMessage)) END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|