Open workbook that is protected with password

  • Thread starter Thread starter ianripping
  • Start date Start date
I

ianripping

Hi I have a workbook that is saved with a password.

I want to create a macro that will opne up this file because it know
the password, eg:

Dim password
password = "letmein"
Dim path
Dim filename
Workbook.open = path & filename 'With password!

Can anyone help with this
 
Ian,

You can include the password in the Open method. E.g.,

Workbooks.Open Filename:=Path & Filename, Password:=Password


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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