3) While opening my Master file, if Update linked files "No" is
selected, then end.
Your help is greatly appreciated.
Ricky
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
(seems reasonable to me.)
Take another look at workbooks.open in VBA's help. You can specify the password
on that command.
--
Dave Peterson
ec3...@msn.com
Thanks,
But I looked through the help for linksources and updatelink and didn't find
anything that looked like it accepted a password.
The closest thing I could come up with is using Sendkeys and if you're unlucky
enough to not be in the right spot, lots of bad things could happen. (Sendkeys
doesn't care what application is active--it doesn't care about anything. It
just sends them just like you typed the characters.)
I created one workbook with one link to a workbook that was password protected.
Option Explicit
Sub testme()
Dim wkbk As Workbook
Dim myLinks As Variant
Dim iCtr As Long
Set wkbk = Workbooks.Open(Filename:="book1.xls", UpdateLinks:=False)
With wkbk
myLinks = .LinkSources
If IsArray(myLinks) Then
For iCtr = LBound(myLinks) To UBound(myLinks)
SendKeys "a{enter}"
wkbk.UpdateLink myLinks(iCtr)
Next iCtr
Else
MsgBox "no links found!"
End If
End With
End Sub
You could keep track of passwords and links and send the right password when you
need to.
If this were something I was sharing with others, I wouldn't use it.
But if it was just for me, I think I might use it and know to not do anything
when the code was running.
I hope that I could fix anything that broke when sendkeys works perfectly, but
doesn't do what I want.
(Nah, I wouldn't use it.)
--
Dave Peterson
ec3...@msn.com
Much appreciated,