+ Reply to Thread
Results 1 to 3 of 3

VBA Code to update links automatically

  1. #1
    Registered User
    Join Date
    11-15-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    97

    VBA Code to update links automatically

    Hi,

    First of all, thanks to all the gurus in the forum who have greatly improved my programming skills by helping me cross my hurdles.

    I have a file for entry of inventory information. This file has links to 4 different excel files. One of the columns in my file is for the current stock quantity. Every time a user completes and entry and starts a new entry, I require a new entry, I require the stock quantity column updated.

    What I find is that the links get updated only when my workbook is closed and reopened or the linked workbook is opened and closed.

    Is there a macro that will update the links automatically without the linked workbook having to be opened.

    There is a menu that does this when the orksheet is unlocked. But I could not get the code when I tried this menu using record macro.

    The code has to run in 2003 version also.

    Any help will be greatly appreciated.

    Anand
    Last edited by anandvh; 01-27-2012 at 02:55 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA Code to update links automatically

    To update all links try:

    Please Login or Register  to view this content.

    To update a specific link try:
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-15-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    97

    Re: VBA Code to update links automatically

    Thanks Royuk for your response.

    I added the line into my code but I got a compile error message "Invalid Use of Property" .

    The following code got this working
    ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources

+ 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