summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/sheet.go b/sheet.go
index ae79acb..bc7cb75 100644
--- a/sheet.go
+++ b/sheet.go
@@ -13,9 +13,13 @@ import (
)
// NewSheet provides function to create a new sheet by given index, when
-// creating a new XLSX file, the default sheet will be create, when you create a
-// new file.
+// creating a new XLSX file, the default sheet will be create, when you create
+// a new file.
func (f *File) NewSheet(name string) int {
+ // Check if the worksheet already exists
+ if f.GetSheetIndex(name) != 0 {
+ return f.SheetCount
+ }
f.SheetCount++
// Update docProps/app.xml
f.setAppXML()