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

Excel Files generated with Excelize cannot be read anymore #1633

Closed
Emanolo786 opened this issue Aug 27, 2023 · 8 comments
Closed

Excel Files generated with Excelize cannot be read anymore #1633

Emanolo786 opened this issue Aug 27, 2023 · 8 comments
Labels
duplicate This issue or pull request already exists

Comments

@Emanolo786
Copy link

Emanolo786 commented Aug 27, 2023

Description

I've been using Excelize with Golang without problem for 2 years.
Recently, although I did not change anything, the excel files generated by my golang module could not be read with Excel for Mac.
The strange item: I did not change anything in my module, which worked perfectly before. It seems that some XML items are not supported any more.
It must be related to the new release of Excel 16.76 on August 15th:
https://learn.microsoft.com/en-us/officeupdates/release-notes-office-for-mac

Steps to reproduce the issue:

  1. Run Go Module
  2. Open Excel File
  3. Get Error message

Describe the results you received:
Here is the message provided when I try to open the file with Excel:

Repair Result to Excel Test0.xml
Errors were detected in file ’pathtofile’

Repaired Part: /xl/worksheets/sheet2.xml part with XML error. HRESULT 0x8000ffff

Microsoft Words for Mac
Version: 16.76 (23081101)

Message:
We found a problem with some content in ’Excel Test.xlsx’. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.

Excel was able to open the file by repairing or removing the unreadable content.

Describe the results you expected:

Output of go version:

(paste your output here)

Excelize version or commit ID:
v2.7.1

(paste here)

Environment details (OS, Microsoft Excel™ version, physical, etc.):
Go module running with Ubuntu Linux
Excel for Mac 16.76 running with MacOS Ventura 13.4.1

@jintaokoong
Copy link

Unsure if it is related, but the same thing occurred to me. Have you check what Go version are you on? I updated mine to the latest stable and it stopped working the way you mentioned. The issue is fixed after downgrading back to v1.20.7.

@RobM83
Copy link

RobM83 commented Aug 28, 2023

I got the same problem, when I locally build the binary it all works fine, this is with version 1.20.6 (darwin/arm64).
When it is build by the gitlab runner, which uses the golang:latest which is currently at 1.21.0 the saving of excel files results in unreadable files. Both produce executable binaries.

@RobM83
Copy link

RobM83 commented Aug 28, 2023

Did some additional testing;

  • Upgrade Excelize from v2.7.1 to v2.8.0 made no difference.
  • Tried using the golang:1.20.6 container for the gitlab-runner (same version as on mine local system) - without succes.
  • Tried using the golang:1.20.7 container for the gitlab-runner with succes (thanks @jintaokoong )

@Emanolo786
Copy link
Author

@RobM83 && jintaokong: Thanks a lot for the feedbacks.
If I understand it correctly, we have to compile on Golang 1.20.7 and it will work ?
If it does not work with Golang 1.21.0, is this a regression ?

@RobM83
Copy link

RobM83 commented Aug 28, 2023

@RobM83 && jintaokong: Thanks a lot for the feedbacks. If I understand it correctly, we have to compile on Golang 1.20.7 and it will work ? If it does not work with Golang 1.21.0, is this a regression ?

Yes, it will probably work with 1.20.7 (at least it did for me :-) ).
No idea if this is a regression.

@xuri
Copy link
Member

xuri commented Aug 28, 2023

If it does not work with Go 1.21.0, please reference the issues #1465, #1595, #1603, #1608, #1614, #1619, #1620, and #1621. 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 the Go team has added golang/go#62051 to the Go 1.21.1 milestone. I suggest using the Go 1.20.7 and previous Go released version or waiting for the next Go minor releases.

@xuri xuri added the duplicate This issue or pull request already exists label Aug 28, 2023
@xuri
Copy link
Member

xuri commented Aug 29, 2023

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 Aug 29, 2023
@Emanolo786
Copy link
Author

I did downgrade to 1.20.7 and it did work for me.
Thank you so much to everyone for your help and support.

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

4 participants