Unprotecting Excel Workbook does not work

Hello,

we try to remove a password protection from a workbook.
Protected123.zip (10,3 KB)

Code:

using (var protectedWorkbook = new Workbook(InputFile, new LoadOptions(){Password = password}))
{
protectedWorkbook.Unprotect(password);
protectedWorkbook.Save(unlockedWorkbook);
}

The output Workbook unlockedWorkbook is still password protected!

I also try this approach with same result:

Kind Regards,
Andy

@AStelzner,

Please set the WorkbookSettings.Password property to an empty string, this should remove the encryption set on loading the spreadsheet. Please try the line instead:
protectedWorkbook.Settings.Password = "";

Let us know if you still find any issue.

Hi,

this works, thanks :blush:

Best Regards,

Andy

dfX3_fdc7b91e-6c57-4128-92c2-5b9fbad02274.png (1.42 KB)

QR8c341bc8-75b7-4e2c-99c3-2d2ba4031ede.png (458 Bytes)

@AStelzner,

Good to know that your issue is resolved by using the suggested line of code. Feel free to write us back if you have further queries or comments, we will be happy to assist you soon.