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

The document is broken and need repair. #1764

Closed
ah-its-andy opened this issue Dec 20, 2023 · 2 comments
Closed

The document is broken and need repair. #1764

ah-its-andy opened this issue Dec 20, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@ah-its-andy
Copy link

Description

Steps to reproduce the issue:
Test Codes:

func TestCreateExcel(t *testing.T) {
	doc := excelize.NewFile()
	defer func() {
		if err := doc.Close(); err != nil {
			t.Errorf("Close excel file failed: %v", err)
		}
	}()
	active, err := doc.NewSheet("Summary")
	if err != nil {
		t.Errorf("NewSheet: %v", err)
	}
	_, err = doc.NewSheet("DataSet")
	if err != nil {
		t.Errorf("NewSheet: %v", err)
	}
	doc.SetActiveSheet(active)
	doc.SaveAs("/path/to/save/test.xlsx")
}

Describe the results you received:
Excel says the docuement had been broken and it will try to fix it.

Output of go version:
1.21

Excelize version or commit ID:

github.com/xuri/excelize/v2 v2.8.0

Environment details (OS, Microsoft Excel™ version, physical, etc.):
Generated in Ubuntu 21, Opened in Windows 11 , Microsoft 365(2311),

@ah-its-andy
Copy link
Author

test.xlsx

@xuri xuri added the duplicate This issue or pull request already exists label Dec 20, 2023
@xuri xuri closed this as completed Dec 20, 2023
@xuri
Copy link
Member

xuri commented Dec 20, 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, #1670, #1686, #1734, and #1752. 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.

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