You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following sample program will create a file named "test.xlsx". After I opened this file with Microsoft Excel Version 2008(Microsoft 365 Apps for enterprise), the "Details" sheet shows out instead of "Summary".
Is it an Excelize bug?
package main
import "github.com/360EntSecGroup-Skylar/excelize/v2"
func main() {
f := excelize.NewFile()
summarySheet := "Summary"
nSummary := f.NewSheet(summarySheet)
detailSheet := "Details"
f.NewSheet(detailSheet)
// remove the default sheet
defaultSheet:="Sheet1"
f.DeleteSheet(defaultSheet)
f.SetActiveSheet(nSummary)
f.SaveAs("test.xlsx")
}
The text was updated successfully, but these errors were encountered:
It is becaused the sheet index changed after I deleted the default sheet.
But even if I move the SetActiveSheet right after the sheet created, it still active the "Details" sheet.
func main() {
f := excelize.NewFile()
summarySheet := "Summary"
nSummary := f.NewSheet(summarySheet)
// this doesn't work if I delete the default sheet after
f.SetActiveSheet(nSummary)
fmt.Println(f.GetSheetName(nSummary))
detailSheet := "Details"
f.NewSheet(detailSheet)
// remove the default sheet
defaultSheet:="Sheet1"
f.DeleteSheet(defaultSheet)
fmt.Println(f.GetSheetName(nSummary))
f.SaveAs("test1.xlsx")
}
The following sample program will create a file named "test.xlsx". After I opened this file with Microsoft Excel Version 2008(Microsoft 365 Apps for enterprise), the "Details" sheet shows out instead of "Summary".
Is it an Excelize bug?
The text was updated successfully, but these errors were encountered: