Try the following:

InputStream is = new java.net.URL("path/to/excel.xls").openStream();

HSSFWorkbook workbook =  new HSSFWorkbook(is);

if it still doesn't work...you might have an excel spreadsheet that is
in excel 95 format.  Quick test is to open the document and do a save
as.  In the drop down box it'll ask what format you want and if it's
95 you'll see 95 selected.

Noah


On Tue, 22 Jun 2004 12:08:24 +0530, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> 
> You may try separating the excel file first from the stream  then read
> it.
> 
> 
> -----Original Message-----
> From: Troy McKinnon [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 22, 2004 11:54 AM
> To: [EMAIL PROTECTED]
> Subject: Unable to read entire header
> 
> I have a big problem, and I am hoping for an easy solution or
> workaround.
> 
> I am trying to read an excel file using POI, but I get the following
> error:
> 
> java.io.IOException: Unable to read entire header; 279 bytes read;
> expected
> 512 bytes
>    at
> org.apache.poi.poifs.storage.HeaderBlockReader.<init><HeaderBlockReader.
> java
> :78>
>   ...
> 
> If I open the file in excel and resave it.. all is good.  Unfortunately
> I
> don't have this option.
> Is there some way to work around this. I am receiving the file as an
> InputStream via Http.
> 
> Troy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to