[AccessD] Linking Excel with password. Error 3161: Cannot decrypt file

MartyConnelly martyconnelly at shaw.ca
Fri May 7 12:12:01 CDT 2004


 I didn't know this but I am afraid you are hooped.

You cannot use ADO to read a password-protected Excel workbook.
The reason is that protecting it with a password actually encrypts the 
workbook on disk
and ADO has no way of decrypting it.

XL2000: "Could Not Decrypt File" Error with Password Protected File
http://support.microsoft.com/?KBID=211378

I guess the only way  to get at this is running application.excel and 
using a password from there
to get at the data.
So you would need a copy of excel on the running macine.

Gustav Brock wrote:

>Hi all
>
>If you try to link/attach an Excel range where the workbook is
>password protected (Save as .. with password), you'll receive the
>error above. 
>The wizard can not accept a password.
>
>I tried, in code, to modify the connect string with
>
>  PWD=mypassword;
>
>so it becomes
>
>  Excel 5.0;HDR=YES;IMEX=2;PWD=mypassword;DATABASE=c:\temp\Test.xls
>
>but that is not recognized when I try to do a RefreshLink - same
>error.
>
>Is this possible?
>
>/gustav
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list