Automatically enter Password in Macro

  • Thread starter Thread starter Pepe
  • Start date Start date
P

Pepe

Hello. I'd like to set up a Macro that automatically opens a Password
protected workbook by having the password in the VBA string. I
thought that the below code would work, but I am prompted for the
password.

Workbooks.Open Filename:="Jan-2004.xls", Password:="password"

How can I set this up so that I'm not prompted for anything. (I'd like
to simply have these run through a scheduler rather than opening each
one just to enter the combination of keys.

Any help is appreciated.

Thank You

Paul
 
You need to specify the password parameter using password:= "string"
(that's colon = )

Workbooks.Open Filename:="Jan-2004.xls", Password:="password"

It worked for me?

Cheers
N
 
Back
Top