dotnetcore / NPOI

A .NET library for reading and writing Microsoft Office binary and OOXML file formats.
Apache License 2.0
1.93k stars 413 forks source link

throw exception Create Sheet from an exist excel file #147

Open sampsonye opened 5 years ago

sampsonye commented 5 years ago
System.InvalidCastException: Unable to cast object of type 'NPOI.HSSF.Record.BOFRecord' to type 'NPOI.HSSF.Record.TabIdRecord'.
at NPOI.HSSF.Model.InternalWorkbook.FixTabIdRecord()
at NPOI.HSSF.Model.InternalWorkbook.CheckSheets(System.Int32 sheetnum) at offset 40
at NPOI.HSSF.Model.InternalWorkbook.SetSheetName(System.Int32 sheetnum, System.String sheetname)
at NPOI.HSSF.UserModel.HSSFWorkbook.CreateSheet(System.String sheetname) at offset 49