Hi, The attached Excel file was protected with password "Excel" on Excel 2003. I got the subject issue when trying to open this file with the following code. This problem only occurs when using Excel 2003. It worked fine when setting the password on Excel 2007 or higher. Does anybody have the same issue or any suggestion?
InputStream is = new FileInputStream(file);
POIFSFileSystem pfs = new POIFSFileSystem(is);
EncryptionInfo info = new EncryptionInfo(pfs);
Decryptor dec = Decryptor.getInstance(info);
if (dec.verifyPassword("Excel"))
{
XSSFWorkbook wb = new XSSFWorkbook(OPCPackage.open(is));
}
Created2010_ProtectedIn2003.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Regards, Isao
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
