-
Notifications
You must be signed in to change notification settings - Fork 55
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
AssertionError when opening some (but not all) files in "rw" mode in openxlsx (no formulas present in any file) #210
Comments
Updates: I rolled back to 0.7.10 and faced no issues. I'll have to stay here until there's some more knowledge about what's going on here. Could this be due to new versions in ZipFile? I didn't see any code that would cause breaking changes like this when moving from 0.7.x -> 0.8.x, but this transition is what causes the issue. |
This is still present in 0.9.x unfortunately :( |
I have this issue, too. Is there a fix, or do I have to roll back to 0.7.10 (and how do I do that, I wonder...) Note: Can't roll back because I'm using |
|
Im still unsure. Personally I would roll back and edit your project to filter empty rows manually. |
I managed to work around this for a while, but now it's got me again and now it's a bigger problem for me. I've done a little digging. I don't understand much, but here is what I've found:
Using some different .xlsx files works just fine. Line 64 in write.jl says
So I tried to see what was going on with
which showed:
for a file that fails whereas, for a working file, it shows
So it looks like XLSX.jl doesn't correctly handle the customXml content. I can manually delete the customXml folder if I open the xlsx file as a zip. If I do that, the file will work again with XLSX.jl.
However, it will no longer work with Excel which offers to try to repair the file. Once repaired by Excel, the file fails again but now with even more customXml elements!
I don't understand the internals of Excel and I don't understand how XLSX.jl works. However, I found the lines:
in the code to read the template file. Are you ignoring these elements on read but requiring them on write? It would be really great to see resolution of this issue. |
Also see this thread on Discourse. I’ve had a go at this with some success. To start with, I edited
This resulted in the following warnings:
Besides these, the process seemed to work for my purposes. I don’t really know how significant these warnings are but I suppose Excel knows best what it puts in these elements of a Second, I changed the initial condition so that the
This also worked for my purpose and without producing any errors or warnings! I ran tests on the revised code which gave the following results:
|
This is a test for issue felipenoris#210. It checks that templates that are read can be written again. It needs an example .xlsx file containing internal customXml files to test.
I'm hoping this PR will be merged soon. I'm still having to use the dev'd version... |
* Update read.jl to pass through Custom XML internal files Addresses issue #210 * Add example containing customXml internal files * Read and write template containing customXml This is a test for issue #210. It checks that templates that are read can be written again. It needs an example .xlsx file containing internal customXml files to test.
When opening a file with
I get
Where the call is occurring during
writexlsx(filepath, xf, overwrite=true)
Originally thought to be a ram issue, I have this calling on hundreds of other excel sheets (some larger, some smaller) with no real telltale sign as to why one would give this error. What's going on here and how can I narrow down why this would happen in a particular file? Alternatively, what's another design pattern I can apply to large files I need to open and edit? I've tried
enable_cache=false
, but on rw it appears to be a requirement to also have it enabled. (https://github.com/felipenoris/XLSX.jl/blob/a9738321c945ad4f1a44c1c6406b260f04d411bb/src/read.jl#L184-187)The text was updated successfully, but these errors were encountered: