R
Ricardo Silva
Hi.
I have a routine that opens all files linked to a specifc worbook, but if
one of the files is already open with changes done I get a message.
How can I check before trying to open? I have no idea what to do.
Thanks
My code is:
Private Sub CommandButton1_Click()
Dim thisFileName As String
Dim alinks As Variant
Dim i As Integer
thisFileName = ActiveWorkbook.Name
alinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(alinks) Then
For i = 1 To UBound(alinks)
MsgBox "Open file" & alinks(i) & "?", vbOKCancel
Workbooks.Open alinks(i)
Next i
End If
Workbooks(thisFileName).Activate
End Sub
I have a routine that opens all files linked to a specifc worbook, but if
one of the files is already open with changes done I get a message.
How can I check before trying to open? I have no idea what to do.
Thanks
My code is:
Private Sub CommandButton1_Click()
Dim thisFileName As String
Dim alinks As Variant
Dim i As Integer
thisFileName = ActiveWorkbook.Name
alinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(alinks) Then
For i = 1 To UBound(alinks)
MsgBox "Open file" & alinks(i) & "?", vbOKCancel
Workbooks.Open alinks(i)
Next i
End If
Workbooks(thisFileName).Activate
End Sub