Please help...
The code below updates links to source files with passwords. It was working fine with only one source file, but know the workbook contains another linked file with another password. I need help to modify the code to prompt for each new password so that all the linked files get updates.
Code: Select all
Sub OpenAndUpdate()
Application.ScreenUpdating = False
On Error GoTo EH
Dim myPass As String
Dim varLink
Dim wbk As Workbook
ResumeCode:
For Each varLink In ThisWorkbook.LinkSources(xlExcelLinks)
Set wbk = Workbooks.Open(Filename:=varLink, Password:=myPass, UpdateLinks:=xlUpdateLinksNever)
Calculate
wbk.Close False
Next varLink
Application.ScreenUpdating = True
Exit Sub
EH:
myPass = InputBox("Supply the next password.", "Link File Password")
GoTo ResumeCode
End Sub