Name

workbook.LinkInfo(Name, LinkInfo, [Type], [EditionRef])

Synopsis

Returns information about a link. The information returned depends on the type of link.

Argument

Settings

Name

The name of the link.

LinkInfo

Determines the type of information to return. Possible settings are xlEditionDate, xlLinkInfoStatus.

Type

The type of link to get information about. Possible settings are xlLinkInfoOLELinks, xlLinkInfoPublishers, xlLinkInfoSubscribers.

EditionRef

If the link is an edition, EditionRef specifies the edition reference. Required if there’s more than one publisher or subscriber with the same name in the workbook.

For example, the following code displays a message telling the user to update Excel links that are out-of-date:

linkSources = ThisWorkbook.linkSources(xlLinkTypeExcelLinks)
If IsArray(linkSources) Then
    For Each link In linkSources
        If ThisWorkbook.LinkInfo(link, xlLinkInfoStatus, _
          xlLinkTypeExcelLinks) = XlLinkStatus.xlLinkStatusOld Then
            MsgBox "Update link: " & link
        End If
    Next
End If

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.