Is it possible to use ClosedXML to open an Excel file protected with a password? And if so, how?
I tried using Interop but it's very slow.
Using Interop.Excel
Microsoft.Office.Interop.Excel.Application wb = xlApp.Workbooks.Open(Filename: "c:\TEST\MyFileProtected.xlsx", ReadOnly: true, Password: "PASSWORD");
I also tried with ClosedXML with no success
string path = openFileDialog1.FileName.ToString();
var wb = new XLWorkbook(path);
wb.Unprotect("password");
I'm getting the error
"File contains corrupted data" creating the XLWorkbook object.