summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-10-23 10:08:29 +0800
committerGitHub <noreply@github.com>2019-10-23 10:08:29 +0800
commite7581ebf3e14f096b6e2d56ed34d381b4af6d310 (patch)
tree7b589d3cb887ac72d0d6681286b7478bfdb4ad55
parent7716968abc1d330492e311504af8951c34fb7520 (diff)
Fix corrupted Excel file issue #413
-rw-r--r--sheet.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/sheet.go b/sheet.go
index 951baf9..9e8d504 100644
--- a/sheet.go
+++ b/sheet.go
@@ -406,6 +406,11 @@ func (f *File) DeleteSheet(name string) {
f.SheetCount--
}
}
+ for idx, bookView := range wb.BookViews.WorkBookView {
+ if bookView.ActiveTab >= f.SheetCount {
+ wb.BookViews.WorkBookView[idx].ActiveTab--
+ }
+ }
f.SetActiveSheet(len(f.GetSheetMap()))
}