Excel - Get paths to linked files (LinkSources)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-20 09:00 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-10-20 11:34 PM
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
------------------------------
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
Consultant
ADP,India
