-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file.parseWorksheet(at: path) dies #94
Comments
Hi @leuski, many thanks for this bugreport and I'm sorry for the delayed reply. Unfortunately, I'm not sure if I'll be able to fix it without a test file, especially it would be hard to add a test case file to expand the test suite. As this seems to be an issue with worksheets, not cell data, I wonder if you could delete all the data from the original file, but keep the worksheets and attach the final result then? I hope there would be no confidential data in worksheet names and even if so, those could be renamed, as long as the worksheets themselves are kept as is. I hope that makes sense, looking forward to your reply! |
Right. Unfortunately, as soon as I re-save the file in Mac Excel 16.35, that issue is gone. I have several excel files that exhibit this behavior (worksheet.target = "/xl/worksheets/sheet1.xml") but a few others from the same source have the default content (worksheet.target = "worksheets/sheet1.xml"). I'll try and track down the source of the files to see if I can reproduce this on an empty file. |
Thank you, much appreciated! |
I have run into the same (or a similar) issue and was curious if there had been any movement here. At the moment, I can't share my files, but am seeing if I can get permission. I have found that the files I have will open in tools like Numbers or Excel without issue, and as soon as they are saved by those tools, the CoreXLSX library can open them just fine. However, before that save, the file fails to parse the workbook
For the resaved version, the worksheet paths are as follows (["xl/worksheets/sheet1.xml"]).
If you try to explicitly parse the worksheet at the path
You get this error:
I have also found that on the problematic file, you can successfully parse the SharedStrings, so it is just something in the structure of the workbook. Happy to refile as new issue if you prefer and to provide anything else I can in terms of information. Hopefully, I can figure out a way to share the actual files. If I can get permission, would there be a way I can share them just with you and to not post here? |
Thanks for the detailed report @robgtsoftware, #119 may fix this, but it's going to be hard to verify on my side without having access to the file. Feel free to send it to hello@corexlsx.org. Otherwise, could you try with the |
Attempt to fix some of the issues reported in #94.
That PR is now merged, so please test with the |
Thank you, this is super helpful! I'll have a look now. |
I've made yet another stab in the dark in #120, the branch is |
Your stab in the dark was spot on, try file.parseWorkbooks() now works as it should for my file. Thanks so much. |
Splendid! The fix will be included in the next 0.13.0 version of the library 👍 |
Thanks again for providing very detailed error messages, these were crucial for coming up with the fix! |
Version
0.9.1
Describe the bug
file.parseWorksheet(at: path) throws CoreXLSXError.archiveEntryNotFound when trying to access a single sheet spreadsheet.
parseWorksheetPaths() returns [ "xl//xl/worksheets/sheet1.xml" ], which looks wrong. I'd guess, because parseWorksheetPaths() does not check that a worksheet.target ("/xl/worksheets/sheet1.xml" in this case) contains a root path and adds the directory prefix ("xl") on top of that.
File for reproduction
Unfortunately, I cannot provide the file in question. Try generating one in Windows version fo Excel.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: