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

Alert:We found a problem with some content in 'Book1.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes. #1619

Closed
ppsleep opened this issue Aug 21, 2023 · 2 comments

Comments

@ppsleep
Copy link

ppsleep commented Aug 21, 2023

Code:

        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)
	}

System: MacOS 12.6.3
Golang: 1.21.0
excelize: v2.7.1

Can you help me? Thank you!

Book1.xlsx

@fifsky
Copy link

fifsky commented Aug 21, 2023

This is a known problem, please refer to #1603

@ppsleep
Copy link
Author

ppsleep commented Aug 21, 2023

This is a known problem, please refer to #1603

Yes, the issue disappeared after I rolled back to go1.20.7. Thank you very much!

@ppsleep ppsleep 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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants