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 Cannot Open Generated File #1620

Closed
teschste-reyrey opened this issue Aug 21, 2023 · 1 comment
Closed

Excel Cannot Open Generated File #1620

teschste-reyrey opened this issue Aug 21, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@teschste-reyrey
Copy link

Description
Anytime I generate a new xlsx file, Excel is not able to open it. I am using Go Modules version github.com/xuri/excelize/v2.
I did some digging and the generated sheet1.xml file file has xmlns="" added to the dimension, sheetViews, sheetFormatPr, and sheetData tags. Through experimentation I was able to determine that if I remove the xmlns="" property from the sheetData tag (or all tags), the workbook will open normally.

Steps to reproduce the issue:

  1. var xlsx = excelize.NewFile()
  2. xlsx.SaveAs([filepath_and_name])
  3. Attempt to open the generated file with Excel and it will report "We found a problem with some content in [filename]. Do you want us to try to recover as much as we can?"

Describe the results you received:
Attempting to open a generated file with Excel produces the message: "We found a problem with some content in [filename]. Do you want us to try to recover as much as we can?"

Describe the results you expected:
The file to open correctly.

Output of go version:

go version go1.21.0 windows/amd64

Excelize version or commit ID:

Environment details (OS, Microsoft Excel™ version, physical, etc.):
Windows 10, Excel 2016
sheet1.txt

@teschste-reyrey teschste-reyrey changed the title Excel Cannot Open Generate File Excel Cannot Open Generated File Aug 21, 2023
@xuri
Copy link
Member

xuri commented Aug 21, 2023

This was duplicated with issue #1465, #1595, #1603 and #1619. I suggest using the previous Go version or waiting for the next minor releases.

@xuri xuri added the duplicate This issue or pull request already exists label Aug 21, 2023
@xuri xuri closed this as completed Aug 21, 2023
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