- Caption of a column in an XLS file
Caption of a column in an XLS file The following code is used to find out the caption of a column in an XLS file. The columns that are entirely empty are not taken into account ( True). This file was opened by xlsOpen.
// Declare the variables XLSFileID is int ResColumnTitle is string // Open an XLS file XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS") IF XLSFileID <> -1 THEN // Column Title ResColumnTitle = xlsColumnTitle(XLSFileID, 3, True) IF ResColumnTitle <> xlsTitleError THEN IF ResColumnTitle = "" THEN // The column has no title Info("The column has no title") ELSE // Display the title of the column Info("The title of the column is: " + ResColumnTitle) END ELSE // Display an error message if the retrieval was not performed Error(xlsMsgError(XLSFileID)) END ELSE // Display an error message if the opening was not performed Error(xlsMsgError(XLSFileID)) END // Close the XLS file xlsClose(XLSFileID)
This page is also available for…
|
|
|
|