check for links

  • Thread starter Thread starter Spike
  • Start date Start date
S

Spike

i will be grateful for a piece of code to check if a worbook opened by the
running macro has any links
 
Will this do what you want?

Sub ListLinks()
Dim aLinks As Variant
aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
Sheets.Add
For i = 1 To UBound(aLinks)
Cells(i, 1).Value = aLinks(i)
Next i
End If
End Sub


HTH,
Ryan---
 
many thanks
--
with kind regards

Spike


ryguy7272 said:
Will this do what you want?

Sub ListLinks()
Dim aLinks As Variant
aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
Sheets.Add
For i = 1 To UBound(aLinks)
Cells(i, 1).Value = aLinks(i)
Next i
End If
End Sub


HTH,
Ryan---
 
Back
Top