+ Reply to Thread
Results 1 to 9 of 9

VBA help - Code to update excel links when file path changes

  1. #1
    Registered User
    Join Date
    11-12-2019
    Location
    Townsville, Australia
    MS-Off Ver
    2016
    Posts
    4

    VBA help - Code to update excel links when file path changes

    Hi all,

    I am really struggling to find an answer to my question so hoping someone here might be able to help.

    I have a set of Excel documents set up as a template for new jobs each time a new job comes in. When we get a new one in I copy and paste the "template" file and rename it as the new file name.

    The file is set up with subfolders, each containing an Excel workbook and they all link to each other (about 50 separate workbooks within the template file) - obviously these links work fine within the original template file but as soon as I copy and paste then none of the links update to the new file path and instead still link back to the original template file.

    Can someone tell me if it's possible to have a macro that will automatically update all 50+ Excel workbooks when I copy and paste the template file to reflect the new file path, rather than me having to go into each separate workbook when I copy it over and restore the links manually?

    Thank you in advance!!

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA help - Code to update excel links when file path changes

    if it's possible to have a macro that will automatically update all 50+ Excel workbooks when I copy and paste the template file to reflect the new file path
    Yes certainly.
    But where are the links, how are they, what to modify in, are all 50 files in the same folder ?
    The easiest way would be to have a short EXCEL sample of the template ...!
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    11-12-2019
    Location
    Townsville, Australia
    MS-Off Ver
    2016
    Posts
    4

    Re: VBA help - Code to update excel links when file path changes

    Thanks for your reply.

    The files are all contained in one main folder, but are divided up into separate sub-folders.

    Hard to say where the links are, but I guess the main one and a good example would be a main "Client Details" sheet which all other sheets link to so you don't have to manually enter job name, title, client name, contact price etc. into each separate sheet.

    Another example is we have a main summary sheet (which also links back to the Client Details sheet) which several other subcontract agreement sheets link back to, so when I put in a price in the subcontract document it shows up on the summary sheet etc., and will also link to a cash flow sheet.

    I hope that makes sense - please let me know if you need further clarification.

    thank you!

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA help - Code to update excel links when file path changes

    Without Excel sample it seems difficult to prepare anything ...!

  5. #5
    Registered User
    Join Date
    11-12-2019
    Location
    Townsville, Australia
    MS-Off Ver
    2016
    Posts
    4

    Re: VBA help - Code to update excel links when file path changes

    Sorry, I'm not sure what you mean by an Excel sample?

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA help - Code to update excel links when file path changes

    Prepare a set of Excel files with dummy data but with links and explain how you will manage with them to simulate the job you need to do.

  7. #7
    Registered User
    Join Date
    11-12-2019
    Location
    Townsville, Australia
    MS-Off Ver
    2016
    Posts
    4

    Re: VBA help - Code to update excel links when file path changes

    Well all the files are already set up and have been in use for some time. The problem is the links breaking when the file is copied over. I just want to know if there's something that can automate the updating of links to the new file path.

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA help - Code to update excel links when file path changes

    I just want to know if there's something that can automate the updating of links to the new file path.
    The answer is, certainly yes, a macro can do it
    Now if you can explain in detail what you are doing manually then a macro can be prepared

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA help - Code to update excel links when file path changes

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-17-2021, 08:19 AM
  2. VBA Code to update links when file path changes
    By Lmendez in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2017, 01:05 PM
  3. [SOLVED] VBA Code change to update multiple links in excel
    By rajeshn_in in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2017, 05:18 AM
  4. Update cell links between 2 excel file without opening source file
    By ferry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-26-2012, 03:03 PM
  5. Replies: 2
    Last Post: 01-02-2012, 02:40 PM
  6. Code Problem(open excel file update links)
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2011, 02:16 PM
  7. Getting excel to update links without opening the file..
    By JONNY981 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2009, 04:51 AM

Tags for this Thread

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