Macro to open password protected files

sarahips

New Member
Joined
Sep 19, 2011
Messages
5
I have a series of workbooks, all are password protected and all link into one central workbook, which is also password protected.

When you open the central spreadsheet you have to input the passwords to all the linking files and I know that I can programme excel to input the passwords for me:

Workbooks.Open "C:\Windows\Desktop\Book2.xls", Password:="password1"
etc

However the problem is that although I have constructed this series of workbooks I am not allowed to know the passwords so I cannot programme them myself and those who will be using the spreadsheets know very little about excel.

I want to know if there is a way to input each password onto a spreadsheet within the central workbook (sheet1), e.g. "password1" will be entered in cell "A1", and then when the macro runs it will take the password from the cell rather than it being written in the macro.

This may sound like it defeats the object of having passwords but only the person that has the password to the central workbook would be able to see the spreadsheet containing the password.

I hope that makes sense, thanks for any help you can give.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top