-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Compatible issue with go1.21.0 xlsx文件无法用Excel打开 #1608
Labels
duplicate
This issue or pull request already exists
Comments
This issue is duplicated with #1465, #1595 and #1603. Also reference golang/go#61881. |
This was referenced Aug 23, 2023
This was referenced Aug 30, 2023
Closed
Closed
This was referenced Sep 6, 2023
This was referenced Sep 14, 2023
Closed
Closed
This was referenced Dec 20, 2023
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
使用Create spreadsheet示例生成的xlsx文件在Excel中报错,测试后发现 /Book1.xlsx/xl/worksheets/sheet1.xml 中 导致Excel打开失败。
package main
import (
"fmt"
)
func main() {

f := excelize.NewFile()
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
}
}()
// Create a new sheet.
index, err := f.NewSheet("Sheet2")
if err != nil {
fmt.Println(err)
return
}
// Set value of a cell.
f.SetCellValue("Sheet2", "A2", "Hello world.")
f.SetCellValue("Sheet1", "B2", 100)
// Set active sheet of the workbook.
f.SetActiveSheet(index)
// Save spreadsheet by the given path.
if err := f.SaveAs("Book1.xlsx"); err != nil {
fmt.Println(err)
}
}
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
MacOS 13.5 (22G74)
Microsoft Excel for Mac 16.75.2(23071901)
The text was updated successfully, but these errors were encountered: