Hi,

I am using POI 3.6

When I try to open an excel file using the following code:

InputStream in = null;
        try {
            //open the workbook
            in = res.openInputStream(task);
            return WorkbookFactory.create(in);
        } finally {
            //ensure the input stream is closed
            if (in != null) try {in.close();} catch (IOException e) {}
        }

The following exception is thrown:

 org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: 
Initialisation of record 0xFF left 2 bytes remaining still to be read.
at 
org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:155)
at 
org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:216)
at 
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:392)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:276)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:201)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:317)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:60)

Please let me know if you would like me to provide the Excel file.

Many thanks

Chris Plastow

Reply via email to