What I don't seem to understand is why the Excel 2003 parser (HSSF) is being
used when I
call WorkbookFactory.create() on this file, instead of the Excel 2007 parser
(XSSF). The
file ends in '.xlsx'.
I decided to force the behaviour, by testing for the file ending:
if ( file.getName().endsWith(".xlsx")) {
wb = new XSSFWorkbook(in);
}
else {
wb = new HSSFWorkbook(in);
}
but that doesn't help:
org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the
specified file:
'C:\DOCUME~1\ajmas\LOCALS~1\Temp\poifiles\poi-ooxml--319334477.tmp'
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:102)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:53)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:176)
...
Any ideas?
André
On 15-Apr-2010, at 18:27, Andre-John Mas wrote:
> This is the tree I am getting:
>
> Root Entry -
> EncryptionInfo
> EncryptedPackage
> _DataSpaces -
> TransformInfo -
> StrongEncryptionTransform -
> Primary <(0x06)Primary>
> Version
> DataSpaceMap
> DataSpaceInfo -
> StrongEncryptionDataSpace
>
>
> On 15-Apr-2010, at 09:26, Nick Burch wrote:
>
>> On Thu, 15 Apr 2010, Andre-John Mas wrote:
>>> I am trying to read an Excel 2007 file and I running into the following
>>> issue:
>>>
>>> java.lang.IllegalArgumentException: The supplied POIFSFileSystem does not
>>> contain a BIFF8 'Workbook' entry. Is it really an excel file?
>>
>> Your file isn't in the expected structure. You could try running
>> org.apache.poi.poifs.dev.POIFS.POIFSLister against it to see what it
>> contains instead
>>
>> Nick
>>
>> ---------------------------------------------------------------------
>> 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]