Automatically enter Password in Macro

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
 
N

Nigel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top