When calling Save
more than once on an already formatted Excel, the values are saved on unexpected cells
#1906
Labels
bug
Something isn't working
Description
I have an empty Excel file I want to fill which contains cells with formatting.
Now my application either calls a function which saves less data (one save call) or more data (more than one save call).
In the first use case everything works as expected.
In the second use case where my application has more than one save calls, excelize will save the values on unexpected cells.
But only the values after the first save call are found on the wrong cells.
Steps to reproduce the issue:
Save()
Save()
againDescribe the results you received:
After first
Save()
call the values are saved on unexpected cell.For example: Save a value on
Z12
will save the value onAS12
.Describe the results you expected:
Save a value on
Z12
should be found onZ12
.Output of
go version
:tested with go1.22
Excelize version or commit ID:
bug reason
I could break down your code to
excelize/excelize.go
Line 294 in 5f58354
Before the first
Save()
callf.checked.Load
will returnfalse
and thanws.checkRow
will fillws.sheetData.R.C
with the missing cells.After the first
Save()
callf.checked.Load
will returntrue
andws.checkRow
will not be called.This is the reason why the
SetCellStr
will write on the wrong cell because only the formatted cells are found inws.sheetData.R.C
.I attached you my sample project to reproduce the issue.
I'm curious to here from you.
bug.zip
The text was updated successfully, but these errors were encountered: