ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically enter Password in Macro (https://www.excelbanter.com/excel-programming/288005-automatically-enter-password-macro.html)

Pepe[_2_]

Automatically enter Password in Macro
 
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

Nigel[_8_]

Automatically enter Password in Macro
 
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

"Pepe" wrote in message
om...
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





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com