Any way to find out what worksheets are in an Excel workbook without reading in the whole thing?

Posted by: c17 on 8 September 2017, 1:36 pm EST

  • Posted 8 September 2017, 1:36 pm EST

    Hi,

    Currently my application reads data in from an Excel worksheet to an FP spread.  The user first browses to the xls file, and then my app reads in the first worksheet using the OpenExcel method. 

    This works well, but instead of always importing the FIRST sheet in the selected workbook, what I'd like to do is display a list of sheets in the workbook and ask the user which one to import.

    Obviously I can display such a list by first reading in the entire XLS file to a non-visible spread, and then querying the spread to see which sheets it contains.  But (since my users are finance people), some of the workbooks are *very* large, and also generate a lot of errors when the whole thing is read in because they are pushing Excel to its limits.   Is there are faster and better way to get the worksheet list -- a way to somehow query a the XLS file for its worksheet list without reading in the whole thing?

    Thank you,

    C17

     

  • Replied 8 September 2017, 1:36 pm EST

    c17 -

    There is a GetExcelSheetNames method that returns a string array for the sheets in the specified file.

  • Replied 8 September 2017, 1:36 pm EST

    Bob,

    How did I miss that?  Thank you!

     --C17

     

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels