We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells cannot read Password protected Excel 2013 files

I’m using aspose-cells-8.1.2 (Java).


I saved an XLSX file using Excel 2013 and tried to open it using Aspose Cells (Java) but it gives me an “Invalid Password” exception.

The file is attached. The password is : 999

Here’s the code which I used to read the XLSX file :
LoadOptions loadOptions = new LoadOptions(FileFormatType.XLSX);
loadOptions.setPassword(“999”);
Workbook workbook = new Workbook(“D:\input5.xlsx”, loadOptions);

And here’s the exception :
Exception in thread “main” com.aspose.cells.CellsException: Invalid password.
at com.aspose.cells.Workbook.b(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at excelTest.AsposeTest.testXLSX(AsposeTest.java:44)
at excelTest.AsposeTest.main(AsposeTest.java:36)

Hi Saurav,

Thanks for your posting and using Aspose.Cells for Java.

We were able to reproduce this exception with the following code using the latest version: Aspose.Cells
for Java v8.2.0.2
. The code throws exception, i.e invalid password exception. It works fine in .NET version of Aspose.Cells though.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40981.

Java


LoadOptions options = new LoadOptions();

options.setPassword(“999”);


Workbook workbook = new Workbook(“input5.xlsx”, options);

workbook.save(“output.pdf”, SaveFormat.PDF);

Exception:
Exception in thread "main" com.aspose.cells.CellsException: Invalid password.
at com.aspose.cells.Workbook.b(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at ClsAsposeTest.f1(ClsAsposeTest.java:402)
at ClsAsposeTest.main(ClsAsposeTest.java:38)

Hi,

Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v8.2.0.3 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40981) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,

I am also facing the same issue ,where i am trying to know if a particular spreadsheet(xls,xlsx) is password protected or not (workbook.isProtected()) But i am getting the below exception:

Exception in thread "main" com.aspose.cells.CellsException: Invalid password.

at com.aspose.cells.Workbook.b(Unknown Source)

at com.aspose.cells.Workbook.a(Unknown Source)

at com.aspose.cells.Workbook.(Unknown Source)

at com.barclays.demo.SpreadsheetPoc.spreadSheet(SpreadsheetPoc.java:28)

at com.barclays.demo.SpreadsheetPoc.main(SpreadsheetPoc.java:20)

I have attached the sample that i have used for testing.Password for that sample is abcd ,Also i tried with the latest jar also i.e. aspose-cells-8.2.0.3.jar .

Thanks

Hi,


I used the following sample code with your template file, it works fine with v8.2.1.x (JAVA):
e.g
Sample code:

LoadOptions options = new LoadOptions();

options.setPassword(“abcd”);


Workbook workbook = new Workbook(“Book1.xlsx”, options);

workbook.save(“out1.pdf”, SaveFormat.PDF);


To know if a workbook is password protected, see the document for your reference:
http://www.aspose.com/docs/display/cellsjava/How+to+Detect+a+File+Format+and+Check+if+the+File+is+Encrypted

Thank you.