List all the workbook links in a workbook using VBA in Microsoft Excel

Place the code below into the standard module

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

 

Comments

  1. I did not find the above included the names. A link is just a formula. To show the full link with path and names use the formula function. Make a sheet called links, format all cells as text (important or it just shows the values!) then loop through all the used rows/columns cells on your main sheet:

    temp = range("A1").Cells(r, c).Formula
    If InStr(temp, ".xls") Or InStr(temp, "!") Then
    Sheets("links").Range("A1").Cells(rout, 1).Value = temp

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.