Add NumSheets to get the number of sheets

This commit is contained in:
Liu Ming
2016-01-21 13:14:37 +08:00
parent 1dd2ce626e
commit 1375b24d9d
3 changed files with 20 additions and 1 deletions

View File

@@ -10,6 +10,15 @@ func ExampleOpen() {
}
}
func ExampleNumberSheets() {
if xlFile, err := Open("Table.xls", "utf-8"); err == nil {
for i := 0; i < xlFile.NumSheets(); i++ {
sheet := xlFile.GetSheet(i)
fmt.Println(sheet.Name)
}
}
}
//Output: read the content of first two cols in each row
func ExampleWorkBook_GetSheet() {
if xlFile, err := Open("Table.xls", "utf-8"); err == nil {