Hi,
I have most of the excel files encrypted, but there are a few that are not encrpypted. Is there a check feature to check to see if there is encryption and if there is none than do not open with the supplied password.
Currently, I am doing something like this to remove an encryption:
//Creating a Workbook object
Workbook workbook = new Workbook();
//Setting the password for the encrypted Excel file
String filePass = "password1";
//Calling open method of Workbook object to open an encrypted file
workbook.open("c:\\EncryptedFile.xls", FileFormatType.DEFAULT, filePass);
workbook.protectFile(ProtectionType.OPEN_FILE, null);
workbook2.copy(workbook);
Some file are not encrypted so they failed at the workbook.open when trying to supply a password.
Is there a check for this first to either supply the password or don't supply it.
Thanks.