Closed DennyHecht closed 1 month ago
Thanks for your issue. This issue was introduced by commit d9a0da7
sheet.go:L170
in v2.8.1, the v2.8.0 works well. I have fixed it, please upgrade to the master branch code, and this path will be released in the next version.
Thanks for the quick support!
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 onZ12
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.22Excelize version or commit ID:
bug reason I could break down your code to https://github.com/qax-os/excelize/blob/5f583549f4cbbd33c7b143532fbccee4d3426653/excelize.go#L294
Before the first
Save()
callf.checked.Load
will returnfalse
and thanws.checkRow
will fillws.sheetData.R.C
with the missing cells. After the firstSave()
callf.checked.Load
will returntrue
andws.checkRow
will not be called. This is the reason why theSetCellStr
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