Sub Update_Links()
For Each wbkPath In ThisWorkbook.LinkSources
If Not IsWorkbookOpen(wbkPath) Then
ThisWorkbook.UpdateLink Name:=wbkPath, Type:=XlLinkType.xlLinkTypeExcelLinks
End If
Next
End Sub
Public Function IsWorkbookOpen(sFileName) As Boolean
If sFileName Like "http*" Then GoTo EXIT_
On Error Resume Next
Open sFileName For Binary Access Read Lock Read As #1
Close #1
EXIT_:
IsWorkbookOpen = IIf(Err.Number > 0, True, False)
On Error GoTo 0
End Function