Include password in VBA code to open file problem

  • Thread starter Thread starter PaulC
  • Start date Start date
P

PaulC

Hi

I have a workbook that is initially opened by the user with a modifying
password. Then when a macro is run I want to be able to close and then
re-open this workbook without having to input the password again.

I have tried:

Workbooks.Open Filename:="D:name.xls", Password:="My_Password"

but I am still asked to enter the password.

How do I do this?

Paul
 
Your code worked for me, I'm running Excel ver 10.0 (OfficeXP).

Most Microsoft software is case sensitive when entering a password. Check
the way you've entered the password in your code.
 

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

Back
Top