You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your work on excelize. This is a really helpful and flexible tool.
I found an issue when an existing formula on the input file is deleted from the cell or moved down when new rows are added.
The error messages are the same to #152
Scenario description
Input file structure
Rows at beginning acting as sheet header.
Data section that I need to populate with new rows.
Cells at bottom with formulas that I need to "rebuild"(update vertical range) after previous step is done.
It would be so helpful if some day this rebuild could be automatic(like Microsoft Excel editor does)
Excelize steps
To apply final formulas result, I need to perform the following:
Scan the whole sheet and find cells with formulas.
Backup sheet formulas info.
Populate sheet with new rows.
Put back the formulas, with the new range calculation.
go env: set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Mind\AppData\Local\go-build set GOEXE=.exe set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\GO_Projects set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Mind\AppData\Local\Temp\go-build976948498=/tmp/go-build -gno-record-gcc-switches
The text was updated successfully, but these errors were encountered:
Hi @ArmandoZepeda, thanks for your issue. I have fixed the issue corrupted xlsx after deleting formula of cell.
However, when using DuplicateRow and DuplicateRowTo, it is still possible to cause file corruption. I have noted this potential problem in the documentation for these two functions.
Since that which will affect changes in references such as formulas, charts, and so on. If there is any referenced value of the worksheet, it will cause a file error when you open it. The excelize only partially updates these references currently.
I think that solving this problem requires the completion of the function adjustHelper. I'll certainly accept that patch if somebody did that.
Uh oh!
There was an error while loading. Please reload this page.
Thank you for your work on excelize. This is a really helpful and flexible tool.
I found an issue when an existing formula on the input file is deleted from the cell or moved down when new rows are added.
The error messages are the same to #152
Scenario description
Input file structure
It would be so helpful if some day this rebuild could be automatic(like Microsoft Excel editor does)
Excelize steps
To apply final formulas result, I need to perform the following:
Issue
Input file info:
Formula deletion:
xlsx, _ := excelize.OpenFile("./HistoryTemplate.xlsx")
sheetName := "Paros"
xlsx.SetCellFormula(sheetName, "E14", "")
xlsx.SaveAs("./output1.xlsx")
Formula moved down:
xlsx, _ := excelize.OpenFile("./HistoryTemplate.xlsx")
sheetName := "Paros"
xlsx.DuplicateRowTo(sheetName, 10, 11)
xlsx.SaveAs("./output2.xlsx")
Error message to open output file:
"Removed Records: Formula from /xl/calcChain.xml part (Calculation properties)"
Files:
HistoryTemplate.xlsx
output1.xlsx
output2.xlsx
go env:
set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Mind\AppData\Local\go-build set GOEXE=.exe set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\GO_Projects set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Mind\AppData\Local\Temp\go-build976948498=/tmp/go-build -gno-record-gcc-switches
The text was updated successfully, but these errors were encountered: