Read Excel file to get list of sheet names
int og_get_excel_sheet_names( LPCSTR lpcszFilename, StringArray * psaSheets )
Number of sheets if success, EXCEL_ERR_FILE_NO_FOUND if file not found
EX1
#include <oExtFile.h> //run by //dlgfile g:=*.xlsx;ee(fname$); void ee(string strFile) { vector<string> vsSheets; //extract sheet names from the given Excel file int nn = get_excel_sheet_names(strFile, &vsSheets); if(nn <= 0) //if no sheets found or file is invalid out_str("not found"); else { //loop and print sheet names to Script Window for(int ii = 0; ii < vsSheets.GetSize(); ii++) { printf("%d: %s\n", ii+1, vsSheets[ii]); } } }
oExtFile.h