This project has moved. For the latest updates, please go here.

How Can I Un-Encrypt (while knowing the password) a .xlsx file before or while loading it to a XLWorkbook?

Aug 21, 2015 at 8:09 PM
I have a excel file with data. When I tried to load the file:

using (var wb = new XLWorkbook(path))
{
}

it wont load. I get an error of: 'System.IO.FileFormatException' occurred in mscorlib.dll

Additional information: File contains corrupted data.

Once I go into the excel file and remove the encryption it works. Is there a way for me to remove the encryption of the file before I open it or while I am opening it?