Bug 6804

Summary: failed to create HSSFWorkbook
Product: POI Reporter: Andy Oliver <poi-support>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.0.2   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Andy Oliver 2002-03-01 21:19:18 UTC
[ 522488 ] failed to create HSSFWorkbook
Email:    (?)
Date:
2002-02-25 07:54 Priority:
5
Submitted By:
C. Mike Davis (c_mike_davis) Assigned To:
Glen Stampoultzis (gstamp)
Category:
HSSF API Status:
Open
Summary:
failed to create HSSFWorkbook
When I execute the following code on the attached
Excel file, I get a RecordFormatException at the
HSSFWorkbook constructor call in the line marked with
the comment "// *****". The attached file was
originally a larger file, but I stripped it down
sequentially to find the minimal example that still
throws the exception.


InputStream input = null;
BufferedInputStream buffInput = null;
POIFSFileSystem fs = null;
HSSFWorkbook workbook = null;
HSSFSheet sheet = null;
try {
URL sourceURL = new URL("file:/d:/data/bad excel
29.xls");
input = sourceURL.openStream();
buffInput = new BufferedInputStream(input);
fs = new POIFSFileSystem(buffInput);
workbook = new HSSFWorkbook(fs); // *****
sheet = workbook.getSheet("Sheet1");
} catch (Throwable th) {
th.printStackTrace();
}



Message:
net.sourceforge.poi.hssf.record.RecordFormatException:
Unable to construct record instance

net.sourceforge.poi.hssf.record.RecordFormatException:
Unable to construct record instance

at
net.sourceforge.poi.hssf.record.RecordFactory.createRec
ord(RecordFactory.java:271)

at
net.sourceforge.poi.hssf.record.RecordFactory.createRec
ords(RecordFactory.java:202)

at
net.sourceforge.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:156)

...

Add A Comment:
Please log in!

If you cannot login, then enter your email address here:

DO NOT enter passwords or confidential information in your message!

Followups:

Message

Date: 2002-02-26 05:16
Sender: acoliver2
Logged In: YES 
user_id=287767

Give me a couple days.  I'll take a look.  Make sure that
your workbook is not protected and that it is an Excel 97 or
better workbook.  (note StarOffice 5.1 actuall generated
more Excel 95ish workbooks)


Attached Files:
Name Description Download
bad excel 29.xls minimal workbook that causes exception Download
Changes:

Field Old Value Date By
File Added 18395: bad excel 29.xls 2002-02-25 07:54 c_mike_davis
Comment 1 Glen Stampoultzis 2002-03-10 10:45:33 UTC
Fixed