Hi,
I am not able to upload password protected file using Microsoft.ACE.OLEDB.12.0 and Microsoft.Jet.OLEDB.4.0.
I am getting Exception like : Could not decrypt file.
What should I do for that?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Joan MillerPosted May 27, 2019, 11:28 PM
Dorothy TincherPosted May 12, 2014, 5:13 AM
http://stackoverflow.com/questions/1356051/read-password-protected-excel-file-using-oledb-in-c-sharp
Also you can try this .NET Excel dll which can read an excel file in .NET without providing or even knowing a password.
After you access/load the file you can even remove that existing password or change it.
Andrew FensterPosted Aug 22, 2011, 11:48 AM
Apparently this is a known problem. This website: http://www.connectionstrings.com/excel says:
"If the Excel workbook is protected by a password, you cannot open it for data access, even by supplying the correct password with your connection string. If you try, you receive the following error message: 'Could not decrypt file.'"
They have a link to a work around: http://www.connectionstrings.com/Articles/Show/how-to-open-password-protected-excel-workbook
I haven't tried it, but it looks like it would work.