+ Reply to Thread
Results 1 to 3 of 3

VB Code to Update All Links in Workbook

Hybrid View

nofzinger VB Code to Update All Links... 11-12-2009, 03:53 PM
mojo249 Re: VB Code to Update All... 11-13-2009, 07:28 PM
nofzinger Re: VB Code to Update All... 11-17-2009, 02:58 PM
  1. #1
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    VB Code to Update All Links in Workbook

    Hi!

    I have a macro that opens a bunch of workbooks and updates them. In addition, after it updates all the workbooks, it updates the links in the active workbook that refer to all the other workbooks that were just updated. The code I use to update the links in the active workbook is very cumbersome:

    ActiveWorkbook.UpdateLink Name:= _
            "<file>" _
            , Type:=xlExcelLinks
        ActiveWorkbook.UpdateLink Name:= _
            "<file2>" _
            , Type:=xlExcelLinks
        ActiveWorkbook.UpdateLink Name:= _
            "<file3>" _
            , Type:=xlExcelLinks
        ActiveWorkbook.UpdateLink Name:= _
            "<file4>" _
            , Type:=xlExcelLinks
    etc.

    I have the same thing over and over for all the links in the workbook. I'll have to keep adding to the list everytime I link a new workbook.

    Is there any simple code that just says "update all links in this workbook" without having to individually list all the actual links?

    Thank you so much!

  2. #2
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: VB Code to Update All Links in Workbook

    Hi

    Set your links to update automatically:

    Edit --> Links --> Start Prompt --> Don't display the alert and update links

    And in your code use

    Calculate
    to refresh the links.

    Dion

  3. #3
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: VB Code to Update All Links in Workbook

    I'm not sure this answers the question. The links do automatically update; I want to be able to update the links as the last stage of my macro. How do I use the "calculate" in my macro?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1