Graham wrote about a glitch he was having with his Excel automation efforts. It seems that a scheduled macro—which would run just fine—would open another workbook in order to update it. He could not get the macro to open the workbook without it displaying a notice asking if the automatic links in the workbook should be opened. The question halted the macro while it waited for Graham's response, and he was looking for a way for the links to be updated automatically, without the bothersome notice.
There are several ways this problem can be approached. First, you can configure Excel so that it doesn't ask the question. This option affects all workbooks opened on the system:
Figure 1. The advanced options in the Excel Options dialog box.
With the check box cleared, Excel no longer asks and all links are updated automatically. If you want an approach that doesn't affect all workbooks, you can follow these steps:
Figure 2. The Edit Links dialog box.
Figure 3. The Startup Prompt dialog box..
Now the workbook can be opened without Excel asking about updates. This, of course, affects just this workbook, and it affects it regardless of how it is opened. In other words, it will affect how the workbook is opened by the macro as well as when it is opened by a user.
Perhaps the best approach is to simply make a small change in your macro—the one that opens the workbook containing links. There is a good chance that the code to open the workbook looks something like this:
Workbooks.Open FileName:="MyWorkbook.xls"
If this is the case, change the line to this:
Workbooks.Open FileName:="MyWorkbook.xls", UpdateLinks:=3
This UpdateLinks property is optional, but without it the "Do you want to update links" dialog box is displayed. If you include the property with the setting shown, then Excel will update both remote and external references in the workbook as it is opened.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8390) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Updating Automatically When Opening Under Macro Control.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
Macros are very powerful, but you may not want them to always be available to a user. Here are some ways you can limit ...
Discover MoreMacros are stored as part of a workbook so that they are always available when you have the workbook open. If you want to ...
Discover MoreYou can create macros that run whenever Excel detects a certain event happening within an entire workbook. This tip ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2020-07-10 10:14:35
J. Woolley
@Lee Amari
I suggest you review Options > Trust Center > Trust Center Settings... > Trusted Locations. Do this for your colleagues' version of Excel. You might also review other Trust Center settings like Trusted Publishers, Macro Settings, External Content, etc. When you install Excel on a new computer, these settings usually default. If possible, compare with previous settings.
2020-07-09 17:50:23
Lee Amari
Good afternoon, I'm having a problem similar to this one stated here . I have a Macro Enabled Template that creates a staff assignment list for my respiratory therapy department. I have a macro that runs on startup and looks to see if the there is a date in a cell. If there is no date if brings up a user form and asks for a valid date in the from MM DD YY the input is validated and if not correct the user is redirected until a valid date is input then the startup macro Renames the template and saves it a Macro enabled workbook with the date amended to the end of the document name. All that works fine. We have used the sheet since 2012 when I made it. There are several cells in the sheet that use the VLOOKUP to retrieve data stored in another Macro enabled workbook. The data it is retrieving are notes that would need to appear on the specified date use in the name of the document. The links work for me any new user the links are broken even though the LOOKUP workbook is in the same shared folder we all have access to on a shared drive. One other feature of the macro is that during the startup macro I have coding that copies each of the VLOOKUP cells and then pastes just the values back into the cell replacing the function during the initial start of the new sheet. This is done to preserve what the daily message was and have the sheet show what the text was even years later after the external file is changed or updated with new dates. This works for me and it will work if I stop the macro and then manually relink the source files. but for some of my coworkers even this doesn't work. In one case the data update says the external file doesn't exist but we can open it manually but the sheet still won't see it.
2019-11-03 07:54:08
Thanks
Thank you for this wonderful mini-tutorial. Very helpful.
2016-12-16 13:14:23
Chris
I ended up using UpdateLinks:="True" and this worked for me with Excel 2010.
2015-03-02 20:58:36
Bruce
I tried the first two steps repeatedly and the links still do not update in Excel 2013 - any suggestions?
Can you give any more information on how to do step 3? I am not familiar with how to work with macros.
Thanks.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments