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

Free Support Forum - aspose.com

How to decrypt an opened workbook

I use LoadOptions.Password to open an encrypted workbook, and if save it, the result file is save password protected on open. Which API can I use to decrypt the workbook before Save? (could not find in docs).


Thanks

Hi Dmitry,


Thank you for contacting Aspose support.

Please set the WorkbookSettings.Password property to an empty string, this should remove the encryption set on loading the spreadsheet. Please check the following piece of code as well as attached samples for your reference.

C#

var book = new Workbook(dir + “book1.xlsx”, new Aspose.Cells.LoadOptions() { Password = “123” });
book.Settings.Password = “”;
book.Save(dir + “output.xlsx”);