Open workbook that is protected with password

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
 
C

Chip Pearson

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
 
Top