Unable to remove (unprotect) password from Excel 2013

Hi Team,


I am using “8.0.1.0” license version to unprotect excel 2013 workbook. I am able to read it using password and I am saving the workbook after unprotecting it but while opening the workbook is asking for password.

I am using the below code snippet:

LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = “xyz”;

Workbook workbook = new Workbook(@“D:\ProtectedWorkbook.xlsx”, loadOptions);

workbook.Unprotect(“xyz”);

workbook.Save(@“D:\UnProtectedWorkbook.xlsx”);

Now while opening “UnProtectedWorkbook.xlsx” it is asking for password.

I have attached the sample excel file for your reference.

Hi Rajesh,


Thank you for contacting Aspose support.

Please try the scenario with following piece of code against your current version of the API. Please note, I have tested the case against Aspose.Cells for .NET 8.9.2.2, whereas the resultant spreadsheet isn’t protected anymore.

C#

LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = “xyz”;
Workbook workbook = new Workbook(dir + “ProtectedWorkbook.xlsx”, loadOptions);
workbook.Settings.Password = “”;
// workbook.Unprotect(“xyz”);
workbook.Save(@“D:\UnProtectedWorkbook.xlsx”);

Thanks a lot. Its working now.

Hi again,


Thank you for the confirmation. It is good to know that you are up & running again. Please feel free to get in touch if you require any further assistance with Aspose APIs. We will be glad to help you out.