poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Rogghe <mrog...@blazent.com>
Subject Excel 2007+ with password protection
Date Thu, 15 Mar 2012 16:16:18 GMT
I've been experimenting with opening password protected (not encrypted) workbooks.  The HSSF
(2003 and lower) versions seem to work fine when using the org.apache.poi.hssf.record.crypto.Biff8EncryptionKey
methods.  The XSSF methods seem to be problematic.


Using the following methods to determine workbook version and get an object to work with:
POIFSFileSystem.hasPOIFSHeader(inputStream), POIXMLDocument.hasOOXMLHeader(inputStream) as
well as the generic WorkbookFactory.create(inputStream).

When I come across a 2007+ workbook that has been saved as password protected POI determines
that the file is in HSSF/BIFF format.

Error generated:
The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel

Has anyone had success opening password protected 2007+ files?

Steps to reproduce:
1.  Create a new Excel file using Excel 2007+.
2.  Save As ->
3. Click Tools -> General Options
4.  Enter a password in both or either fields.
5. OK and save.
6. Attempt to read the file using POI.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message