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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Andrew FensterRank #983 · 2K reputationPosted Aug 22, 2011, 7:48 AM EDT
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.
Dorothy Tincher10 reputationPosted May 12, 2014, 1:13 AM EDT
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.
Joan Miller7 reputationPosted May 27, 2019, 7:28 PM EDT