Automatically input password on linked workbook

DrH100

Board Regular
Joined
Dec 30, 2011
Messages
78
Hi all, hope someone can help me please.

I have 2 workbooks that are linked together.

Book1 pulls information from Book2 and displays it in a table and graph for colleagues to use.

Book 2 is password protected so that only I can view the details in it. The password is currently "lion".

When my colleagues open Book1 they are prompted to input the password for Book2 in order update the links so I put

Private Sub Workbook_Open()
Workbooks.Open Filename:="Book 2 File path etc", Password:="lion"
ActiveWindow.Close
End Sub

in to Book1 in the hope that this would open book 2 input the password and close Book2 taking away the need - which works but only after my colleague inputs the password - defeating the object.

I guess my question therefore is, is there a way that when Book1 is open and the password for book 2 is requested it can automatically be complete, links updated without the users getting access to book 2?

Hope that makes some sense but I still pretty new to this VBA stuff and this is way over my head
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi

Is it password protected to open and modify?

Try this;

Rich (BB code):
Workbooks.Open Filename:="Book 2 File path etc", Password:="lion", WriteResPassword:="lion"


I don't know if that'll solve your problem, or what else to try if not though, so fingers crossed that'll work :)
 
Upvote 0
Thanks for the reply

Not quite what I needed but not something I hadnt considered. Think I've solved my problem though using a copy and paste method.

Thanks very much.
 
Upvote 0

Forum statistics

Threads
1,215,359
Messages
6,124,488
Members
449,165
Latest member
ChipDude83

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