Add method to get worksheet names in the same order they appear in excel (for review/comments only)#51
Open
RyanDansie wants to merge 1 commit intopaulyoder:masterfrom
Open
Conversation
Owner
|
Thanks for the pull request @RyanDansie! I would like to keep the .Net framework dependency at v3.5 if possible, so do you know the reason to require v4.5? I might be convinced to upgrade the dependency to 4.5, but I want to make sure it's worth while. |
Author
|
.net 4.5 is for the one line unzip of the xlsx file (ZipArchive class). I'm sure I could change that part to use DeflateStream. |
Owner
|
If it's not too hard to use DeflateStream, that would be great. If it requires more work, then I could go ahead and create version 2.0 of LinqToExcel and make it depend on .Net 4.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: