Macro ro update links from protected workbooks

  • Thread starter Thread starter JON JON
  • Start date Start date
J

JON JON

Dear NG,

I have a workbook.open in my code and the updatelink is set to true. My
problem is that it keep asking me the password (open password) of the link
workbook. Is it possible to write the password in the code itself so it
wont ask me anymore.
Opening all the files before the updatelink is not option for me since this
involves many files and will take a long time to open it all.

Hope someone could help

TIA

Jon-jon
 
Hello, David,

Thanks for the reply but I guess I did not make myself clear. I don't mean
the worksheet protection that prevents the workbook to be edited but rather
the protection that prevents other user from opening the files itself. The
code goes something like this:

Sub myCode()
....
Workbooks.Open Filename:="C:\\myfile.xls", Updatelink:=True
....
End Sub

The problem lies on this particular code is that myfile.xls contains
formulas that refer to another files which is not open and also have
"password to open". Because of that, when myfile.xls try to update the
links(formula) it ask for a password.
before it could continue. Is there a work around so that I can supply the
password through code (not sendkeys since I guess it is unreliable.

Hope I make sense.

Thanks Again.

Jon-jon

Protection, Worksheet
http://www.mvps.org/dmcritchie/excel/protection.htm
 
Jon Jon,

Workbooks.Open Password:="mypassword"

For more info, see the help on the Open method. Put the cursor on "Open"
and press F1.

Don't forget that anyone who knows how to get to the VBE can see the
password.
 
Back
Top