Open password workbook not working

G

Guest

I am using this code
Workbooks.Open Filename:="I:\Aging\Month End\CMT Monthly Aging 07.xls",
Password:="atervse"

But I am still prompted for the password. I want the file to open with
write rights without being prompted. Where am I going wrong?
 
G

Guest

Are you providing the correct password?

Also note that there are two types of password arguments:

Password Optional Variant. A string that contains the password required to
open a protected workbook. If this argument is omitted and the workbook
requires a password, the user is prompted for the password.

WriteResPassword Optional Variant. A string that contains the password
required to write to a write-reserved workbook. If this argument is omitted
and the workbook requires a password, the user will be prompted for the
password.
 
G

Gary Keramidas

try this

Workbooks.Open Filename:="I:\Aging\Month End\CMT Monthly Aging 07.xls", _
Password:="atervse", WriteResPassword:="atervse"
 
G

Guest

Perfect!
Can we get a brief explanation why this works when passiing both password
arguments at the same time?

:beer:
 

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