Password in linked workbook

  • Thread starter Thread starter rob nobel
  • Start date Start date
R

rob nobel

Hi,
I have a workbook linked to another workbook that has a password. Is there
some code I can put into the workbook open() event that will bypass the
request to enter the password?
Rob
 
Check out the Open method in VBA Help: it will show you how to use
the password argument when opening a file.

Nothing you put in the password-protected workbook (i.e., the
Workbook_Open() event) will help you since the workbook won't open
unless the password has been given.
 
Hi J.E,
I am well aware of how to open the file using the password argument BUT, I
do not want to open the file.
I only want the links to that file to be updated without me having to enter
the password upon opening a workbook called "Main".
That procedure I cannot find in any helps.
I currently use the following procedure to open the file if I want to open
it...... (but I need automatic updating of links to the workbook named
"Special" when I open the workbook named "Main".) I presume something
similar would be needed in the Private Sub Workbook_Open() event (but to not
open the file) only to update links/references without having to type in the
password.

Rob
Public Sub Special_Click()
Const PASSWORD = "password"
Workbooks.Open Filename:="c:\My Documents\Accounts - Me\Special.xls", _
PASSWORD:="password"
Windows("Special.xls").Activate
End Sub
 
I don't think you'll find anything in excel (through xl2002) that does what you
want. But you might be able to cheat by using Sendkeys.

http://groups.google.com/[email protected]

(I don't think I'd share this with others--too many things could go wrong. But
if it's just for you, you should be able to react if something breaks--since
you'll be the developer!)
 
Thanks Dave,
But I think I might forget doing this altogether as it seems fraught with
danger and it's not a huge effort to type the password each time.
Rob
 

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