Morning Andre,
I cannot help with the original porblem, but do not be confused about the
file extension. It is quite likely that the application or person who
generated the file decided that was the correct extension or it could even
have been changed later following creation. The Office applications are very
tolerant of this - rtf files with .doc extension and so on.
If you want to convince yourself that you are really dealing with an Excel
2007, zipped xml file archive, then all you need to do is use a utility such
as WinRAR or PKUnzip to open the troublesome .xlsx file. If it really is a
valid SpreadsheetML file, then you will be able to see a collection of files
and folders.
The one other format that I can think of is the older - and long abandoned -
2003 xml file format. Can you open the file using a simple text editor - not
something like Word but a really simple editor such as Notepad? If you can
and you see xml markup then you do have an Excel 2003 xml format file.
Yours
Mark B
Andre-John Mas-4 wrote:
>
> 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]
>
>
>
--
View this message in context:
http://old.nabble.com/The-supplied-POIFSFileSystem-does-not-contain-a-BIFF8-%27Workbook%27-entry.-Is-it-really-an-excel-file--tp28255113p28263612.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]