Hi all,
I’m trying to pass a dataframe to a large xlsm file (80mbs). The code I’m using is as follows:
using XLSX, DataFrames
XLSX.openxlsx("xlsm_file.xlsm", mode ="rw" ) do xf
# pass through the dataframe, df
sheet = xf["sheet1"]
for r in 1:size(df,1), c in 1:size(df,2)
sheet[XLSX.CellRef(r , c )] = df[r,c]
end
end
This takes a really long time and eventually crashes giving the following error:
AssertionError: isempty(XML_GLOBAL_ERROR_STACK)
I have rerun the code using a smaller version of the file (i.e… removing formulas, tabs etc) and the code runs ok.
I also tried updating the code to disable caching using:
XLSX.openxlsx("xlsm_file.xlsm", enable_cache = false ) do xf
# pass through the dataframe, df
sheet = xf["sheet1"]
for r in 1:size(df,1), c in 1:size(df,2)
sheet[XLSX.CellRef(r , c )] = df[r,c]
end
end
But this gives:
AssertionError: XLSXFile instance is not writable.
Is there a way to disable caching while in “rw” mode?
Any recommendations on how to write to large excel files?
Thanks in advance.