Error checking help
Posted by Anis on March 13, 2000 6:54 AM
Hi I have this macro code for opening all the links and sub links in spreadsheet. I get errors when the one of the links is already open and macro tries to reopen it again. How can I include error checking code so that, if the link spreadsheet is opened once it will not try to open it again but continue with next link.
Private Sub Workbook_Open()
alinks = ActiveWorkbook.LinkSources
For i = 1 To UBound(alinks)
Workbooks.Open alinks(i), False
blinks = ActiveWorkbook.LinkSources
On Error Resume Next
For j = 1 To UBound(blinks)
Workbooks.Open blinks(j), False
Next
On Error GoTo 0
Next
ThisWorkbook.Activate
End Sub