Blue Prism Product

last person joined: 2 days ago 

Chat about Blue Prism products
Expand all | Collapse all

Excel - Get paths to linked files (LinkSources)

  • 1.  Excel - Get paths to linked files (LinkSources)

    Posted 8 days ago

    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.


  • 2.  RE: Excel - Get paths to linked files (LinkSources)

    Posted 5 days ago
    Edited by Nilesh Jadhav 5 days ago
    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
    ------------------------------