Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write / Save Corrupts Workbook #1686

Closed
jspanjaard opened this issue Oct 9, 2023 · 4 comments
Closed

Write / Save Corrupts Workbook #1686

jspanjaard opened this issue Oct 9, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@jspanjaard
Copy link

Description
Opening and then writing or saving the attached workbook results in it being corrupted.
RT0001C86_CSSF SFDR Precon Report Data Collection Template v1.8.xlsx

Steps to reproduce the issue:
Tested with the following code to simply open and close.
f, err := excelize.OpenFile("templates/RT0001C86_CSSF SFDR Precon Report Data Collection Template v1.8.xlsx") f.SaveAs("RT0001C86_GenerateExcelTest 3.xlsx")

Describe the results you received:
When trying to recover the workbook, receive the following dialog.
image

Environment details:

  • Package v2.8.0
  • Golang 1.20
@jspanjaard jspanjaard changed the title Write / Save Creates a Bug Write / Save Corrupts Workbook Oct 9, 2023
@jspanjaard
Copy link
Author

Here is the information from the error log:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error049960_04.xml</logFileName><summary>Errors were detected in file '\\Mac\Home\Downloads\RT0001C86_GenerateExcelTest.xlsx'</summary><removedParts><removedPart>Removed Part: /xl/styles.xml part with XML error. (Styles) HRESULT 0x8000ffff Line 2, column 0.</removedPart></removedParts><repairedRecords><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet1.xml part</repairedRecord><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet2.xml part</repairedRecord><repairedRecord>Repaired Records: Conditional formatting from /xl/worksheets/sheet2.xml part</repairedRecord><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet4.xml part</repairedRecord></repairedRecords></recoveryLog>

@xuri
Copy link
Member

xuri commented Oct 9, 2023

Thanks for your issue. If you are reporting a new issue, make sure that we do not have any duplicates already exist. If it does not work with Go 1.21.0, please reference the issues #1465, #1595, #1603, #1608, #1614, #1619, #1620, #1621, #1623, #1633, #1637, #1641, #1642, #1648, #1651, #1652, #1656, #1657, #1660, #1663 and #1670. There are some incompatible changes in the Go 1.21.0 encoding/xml library. I have given feedback to the Go team and created a patch for it (golang/go#61881), and it has been fixed on Go 1.21.1. Please using the Go 1.20.7 and previous Go released version or upgrade to Go 1.21.1 and later. I have added notice on the README and documentation website for this, and I've closed this. If you have any questions, please let me know, and reopen this anytime.

@xuri xuri closed this as completed Oct 9, 2023
@xuri xuri added the duplicate This issue or pull request already exists label Oct 9, 2023
@jspanjaard
Copy link
Author

jspanjaard commented Oct 9, 2023

I have updated the runtime to Go 1.21.2 and tested on Go 1.19 and the issue persists.
The issue doesn't appear when testing on a simple workbook without conditional formatting.

I don't think this is a duplicate of the existing issues?

@xuri
Copy link
Member

xuri commented Oct 10, 2023

Thanks for your feedback. This problem has been fixed, duplicated with #1666 and #1672. Please upgrade to the master branch code, and this patch will be release in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants