I'm trying to open an encrypted XLSX file with the following code:

POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("Book1.xlsx"));
EncryptionInfo info = new EncryptionInfo(fs);
Decryptor d = new Decryptor(info);
d.verifyPassword("hula");
XSSFWorkbook wb = new XSSFWorkbook(d.getDataStream(fs));

But, I still get this error: Exception in thread "main"
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data
appears to be in the Office 2007+ XML. You are calling the part of POI that
deals with OLE2 Office Documents. You need to call a different part of POI
to process this data (eg XSSF instead of HSSF).

Do you have any idea what I'm doing wrong and what the solution is?

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/How-to-check-whether-an-XLSX-has-a-read-password-tp4761975p4835150.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]

Reply via email to