cancel
Showing results for 
Search instead for 
Did you mean: 

Excel - Get paths to linked files (LinkSources)

I have a file that is linked to some other files. I need to open all of the linked files, because sometimes they're not updated. How can I do that?

If I could get a collection with the paths to all the linked files, then I can open them and update them with others objects that I already have. In VBA it's something like:

collection = ThisWorkbook.LinkSources(xlExcelLinks)

Edit: I can open the linked table list using Alt+E+K, but I don't think that's useful if any code stage can be programmed

--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by Dylan.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 REPLY 1

Hi,

You can use below VBA code as requested. I have created and tested

Prerequisite - Excel workbook should have some excel linked.

Sub DisplayLinkStatus()


Dim NewColl As New Collection

LinkSources = ThisWorkbook.LinkSources(xlExcelLinks)
      If IsArray(LinkSources) Then
          For Each link In LinkSources
                'NewColl.Add link
               Debug.Print link
          Next
      End If
End Sub

If you find your ans please click on best answer button,



Thanks
Nilesh

------------------------------
Nilesh Jadhav
Senior RPA Specialist
ADP
------------------------------
Nilesh Jadhav.
Consultant
ADP,India