Add method to get worksheet names in the same order they appear in excel (for review/comments only) #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This provides a method GetWorksheetNamesOrdered() to return the worksheet names in the same order as they would appear in excel.
Works by extracting the contents of the excel file, finding the XML file containing the worksheet names and parsing the XML contents of that file. I found the necessary information about the xlsx file format from this stack overflow answer:
http://stackoverflow.com/a/19930386/2617732
Using the test excel files, the new method works fine with the xlsm and xlsx files. It also works with csv by returning an empty list. It doesn't work for the xls and xlsb files as they have a different format. If anybody knows where the same worksheet information could be found within an xls file, please comment on here.
Notes: