@felipenoris I can try later to paste some adapted code that replicates the error. I’m just trying to write some values calculated in Julia on an Excel template using XLSX.openxlsx(…, mode=“rw”) Meanwhile, from the error message I can understand that the function openxlsx uses a SheetRowIterator to read sheet content, but it returns nothing because of “@assert !isopen(state)” on line 122 of stream.jl

I tried what you told me, but I’m still having the same problem. I also tried constructing a simplified version of my datasets, of my excel template and of the code I’m working on, but (sadly) I’m not able to reproduce the error message I’m getting (somehow, the writing I need to do on my excel template works just fine on the simplified version).

The error message I’m getting is because of the row iterator that openxlsx uses. It reads: “AssertionError: !(isopen(state))”. What does that mean? Is the function failing to close the xlsx file after editing, which causes an error or something like that?