Skip to content

AssertionError when opening some (but not all) files in "rw" mode in openxlsx (no formulas present in any file) #210

@Boxylmer

Description

@Boxylmer

When opening a file with

 XLSX.openxlsx(results_path, mode="rw") do xf
        sheet = xf[sheet_name]
        # more reading functions
end

I get

ERROR: AssertionError: Some internal files were not loaded into memory. Did you use `XLSX.open_xlsx_template` to open this file?
Stacktrace:
 [1] writexlsx(output_filepath::String, xf::XLSX.XLSXFile; overwrite::Bool)
   @ XLSX C:\Users\Will Laptop\.julia\packages\XLSX\FFzH0\src\write.jl:64
...

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions