Decrypting an XLSX file and re-encrypting it results in an Excel error

Hello,

We use Aspose to decrypt and re-encrypt files. We are using Aspose.Cells 7.4.3.2. When we decrypt xlsx files and re-encrypt them, opening the file in Excel will display a message that the file format or file extension is not valid.

We are using Excel 2010 to open the file.

Provide is a sample xlsx file with password Password1

Thank you,
Kim

Hi,

Please try using our latest version/fix Aspose.Cells for .NET (Latest Version) , it works fine as I tested. I used the following sample code with your template file. The generated Excel file opens fine in MS Excel 2007 and 2010.

Sample code:

string password = “Password1”;

LoadOptions loadOptions = new LoadOptions(LoadFormat.Xlsx);

loadOptions.Password = password;

Workbook workbook = new Workbook(“e:\test2\Excel_OpenPassword.xlsx”, loadOptions);

workbook.Settings.Password = “NewPassword1”;

workbook.Save(“e:\test2\outExcel_OpenPassword1.xlsx”);

If you still find the issue, give us your sample code and attach your output file here, we will check your issue soon.

Thank you.

Thank you. We will try this.

Hello,

We are still seeing the issue with Aspose.Cells 7.5.0.1. We will verify the code we are using against the sample you have provided. If we continue to see the issue we will provide more details.

Thank you,

Kim

Hi,


Yes, sure, If you still find the issue, give us your sample code (runnable) and attach your template file(s) here, we will check your issue soon.

Thank you.