I have tried this code so far which is selecting excel sheet. Now I want the names of sheet inside the excel, How to achieve this?
void clicked() { container conFilter = ["Microsoft Excel 97-2003 Worksheet (.xls)" ,"*.xlsx"]; Dialog _dialog; DialogField _file; ExcelSpreadsheetName XLSX; SysExcelWorksheet worksheet; boolean fileExists; ; //Prompt to import excel _dialog = new Dialog("Please select the file to load"); //_dialog.addText("Select file:"); _file = _dialog.addField(ExtendedTypeStr("FilenameOpen")); _dialog.filenameLookupFilter(conFilter); _dialog.filenameLookupFilter(["Microsoft Excel 97-2003 Worksheet (.xls)" ,"*.xlsx"]); _dialog.filenameLookupTitle("Upload from EXCEL/CSV"); // _dialog.filenameLookupInitialPath('worksheet'); _dialog.run(); if (_dialog.closedOK()) { info(_file.value() ); } super(); }
Any help would be appreciated.