Bug 61397

Summary: Unable to read excel using HSSFWorkbook in poi 3.8 but works fine in 3.0, I cannot downgrade the version.
Product: POI Reporter: Manju <manju.ganesan>
Component: HSSFAssignee: POI Developers List <dev>
Severity: blocker    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Manju 2017-08-10 06:34:52 UTC
I am using an excel of version Microsoft Excel 97-2003 Worksheet (.xls). I am trying to read the excel in java using following code. I am using poi 3.8 version
 fis = new FileInputStream(filename);
 HSSFWorkbook workbook = new HSSFWorkbook(fis);

I am getting the following error. 
Exception in thread "main" java.lang.RuntimeException: Unexpected record type (org.apache.poi.hssf.record.ColumnInfoRecord)
	at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.<init>(RowRecordsAggregate.java:107)
	at org.apache.poi.hssf.model.InternalSheet.<init>(InternalSheet.java:208)
	at org.apache.poi.hssf.model.InternalSheet.createSheet(InternalSheet.java:163)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:296)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:248)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:192)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:327)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:308)
	at com.wona.ExcelExtractService.main(ExcelExtractService.java:28)

It works fine in poi 3.0 version, but i cannot downgrade to an older version.

On opening in excel and resaving it in different name the new excel works fine. I cannot resave the excel and use all the time. Need a fix for it.
Comment 1 Javen O'Neal 2017-08-10 06:55:54 UTC
Have you tried to open the workbook with a newer version of POI, such as POI 3.16? 3.8 is pretty old.

Are you able to share the Excel file?
Comment 2 Dominik Stadler 2017-09-13 20:01:19 UTC
Sorry, we cannot help much if you can not provide any additional information here.