Skip to content
New issue

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

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

Already on GitHub? # to your account

使用官方案例生成的Excel无法打开 #1840

Closed
yunkeweb opened this issue Mar 7, 2024 · 5 comments
Closed

使用官方案例生成的Excel无法打开 #1840

yunkeweb opened this issue Mar 7, 2024 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@yunkeweb
Copy link
Contributor

yunkeweb commented Mar 7, 2024

go版本:go version go1.21.0 windows/amd64
打开文件报错截图:
image

@xuri xuri added the duplicate This issue or pull request already exists label Mar 7, 2024
@xuri
Copy link
Member

xuri commented Mar 7, 2024

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, #1670, #1686, #1734, #1752, #1764, #1768 and #1774. 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.12 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.

谢谢您的议题,在您创建新的议题之前,请确保不存在任何重复的议题。这与已有议题重复,请参考 #1465, #1595, #1603, #1608, #1614, #1619, #1620, #1621, #1623, #1633, #1637, #1641, #1642, #1648, #1651, #1652, #1656, #1657, #1660, #1663, #1670, #1686, #1734, #1752, #1764, #1768#1774。Go 1.21.0 对 encoding/xml 标准库做了不兼容的更改,我已将该问题反馈至 Go 团队,并提交了修复补丁 golang/go#61881,已在 Go 1.21.1 中修复。请使用 Go 1.20.12 以及更早版本,或升级 1.21.1 及以上版本。我已经为此在自述文档和文档网站上添加了通知,因此我将关闭此议题。如果您有任何问题,请告诉我,并可随时重新打开。

@xuri xuri closed this as completed Mar 7, 2024
@yunkeweb
Copy link
Contributor Author

yunkeweb commented Mar 7, 2024

感谢作者大大,我已仔细查看文档并找到自己的问题。多谢您的回复

@yckbilly1929
Copy link

感谢作者大大,我已仔细查看文档并找到自己的问题。多谢您的回复

我还是遇到同样的问题,请问你是如何fix的。我是Sheet1 OK,但NewSheet的Sheet2报错。

@xuri
Copy link
Member

xuri commented Dec 20, 2024

@yckbilly1929 which Go version are you using? Please read the Go version notice in the documentation.

@yckbilly1929
Copy link

@yckbilly1929 which Go version are you using? Please read the Go version notice in the documentation.

Fixed. I'm using 1.23.4 and excelize 2.9.0.

The root cause is I forgot to do streamWriter.Flush() in the new sheet. Turns out it opens correctly in WPS and Lark, but reports corrupted in MS Excel.

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

No branches or pull requests

3 participants