To open an Excel workbook with VBA and skip updating its external workbook links, pass UpdateLinks:=0 to Workbooks.Open. For example, use Set wb = Workbooks.Open(Filename:=filePath, UpdateLinks:=0); this opens the file without fetching current values from linked workbooks.
What UpdateLinks:=0 means
Excel workbooks can contain formulas that refer to cells in other workbooks, such as ='[Prices.xlsx]Sheet1'!$B$2. When a workbook containing these links opens, Excel may ask whether to update them. Updating can retrieve values from the linked source files, which may be elsewhere on a network or unavailable at the moment.
The UpdateLinks argument tells Excel what to do with external references when opening a workbook:
UpdateLinks:=0opens the workbook without updating external references.UpdateLinks:=3updates external references as the workbook opens.
If you omit the argument, Excel can ask the user whether to update links. The important distinction is that zero means “do not update,” not “remove the links.” The formulas and link definitions remain in the workbook. If you later choose to update them, or open the file another way with updates enabled, Excel can still use those links.
When links are not updated, formulas that depend on them generally show the values last stored in the workbook rather than newly retrieved values. Those values can be old or blank, so a workbook that opens successfully may still not contain current linked data. The setting controls link updating during this open operation; it is not a general instruction to freeze every formula or calculation in the file.
Basic VBA pattern
Here is a minimal example for Excel for Microsoft 365 on Windows. Change the path to the workbook you want to open. The UpdateLinks argument is a named argument, so its purpose is clear and its position among the optional arguments does not need to be counted.
Sub OpenWorkbookWithoutUpdatingLinks()
Dim filePath As String
Dim wb As Workbook
' Set this to the workbook you want to open.
filePath = "C:\Reports\Source.xlsx"
' Open the workbook without updating external workbook links.
Set wb = Workbooks.Open(Filename:=filePath, UpdateLinks:=0)
End Sub
Save a copy of the workbook that contains the macro before running it. VBA actions generally cannot be undone with Ctrl+Z, and opening a workbook is only one part of what a larger macro might do. If the code is stored in a macro-enabled workbook, save that file as an .xlsm file. Do not enable macros in files from sources you do not trust.
The example opens the target workbook for normal editing. If you only need to read it, add ReadOnly:=True as another named argument: Workbooks.Open(Filename:=filePath, UpdateLinks:=0, ReadOnly:=True). Read-only mode helps avoid accidental changes to the source file, but it does not change the meaning of UpdateLinks:=0.
Using the setting in a larger macro
A macro can open a workbook without updating links, read or copy information from it, and then close it. Keep a reference to the returned workbook in a variable so that later statements address the file you just opened, rather than whichever workbook happens to be active.
For instance, after the example opens the file, code can refer to wb.Worksheets("Summary") to work with its Summary sheet. That reference does not refresh external links. If your procedure copies data into another workbook, decide separately whether the copied formulas should remain formulas or be converted to values; UpdateLinks:=0 does not make that choice for you.
For a dependable automated process, also consider how the macro should respond to a missing file, a wrong path, or a workbook that requires a password. Those are separate opening problems and are not resolved by the link argument. Production code can use error handling to report a failed open clearly, rather than assuming that the workbook was opened. If the macro opens several files, apply the argument on every relevant Workbooks.Open call.
What this setting does not suppress
UpdateLinks:=0 is specific to external workbook links. It is not a universal “open silently” switch, and it does not disable every external-data or security feature in Excel. A workbook may contain Power Query queries, other data connections, macros, embedded objects, or links that are handled by their own features and settings. Do not assume that this argument prevents every one of those items from refreshing or prompting.
It also does not guarantee that no dialog will appear. Excel can still need input for a password, a file-format issue, a read-only recommendation, or another condition. A missing linked source may not matter when links are not updated, but a missing main workbook or an inaccessible folder will still prevent the file from opening.
Nor is this argument a security measure. A workbook can contain macros, and macro security is controlled separately. Keep Excel’s macro security protections in place and open files only from trusted sources. Avoid setting Application.DisplayAlerts = False simply to hide prompts: that setting affects a wider range of alerts, and it is not a substitute for explicitly choosing whether links should update.
Choosing between skipping and updating links
Use zero when the goal is to inspect a workbook without contacting source workbooks, preserve the saved linked values during an automated open, or avoid a user decision in a controlled workflow. It is often useful when source files are offline, when a report must open quickly, or when a macro will extract information that does not require newly refreshed external values.
Use UpdateLinks:=3 when current values from linked workbooks are required and the sources are available and appropriate to use. Before choosing, consider:
- Freshness: Does the task need values from the source as it exists now, or are the values saved in the destination workbook acceptable?
- Availability: Can the computer running the macro access the linked files, including any network locations?
- Trust: Are the linked sources expected and trusted? Updating can retrieve information from those sources.
- Repeatability: Should every run use saved values, or should results change when a source workbook changes?
If you skip updates for a report that users will rely on, label or document that choice. Otherwise, someone may interpret an older displayed value as current. If the workbook needs current data, consider updating links deliberately and then checking that the expected sources are reachable.
How this differs from Excel link prompts
Excel also has the application-level Application.AskToUpdateLinks property. It controls whether Excel displays a prompt when opening workbooks with links; it is not the clearest way to express a per-workbook decision. In particular, disabling that prompt should not be treated as equivalent to “never update”: the behavior concerns whether Excel asks, rather than providing the explicit per-open choice that UpdateLinks:=0 provides.
For a macro that must skip updates for one particular file, pass UpdateLinks:=0 directly to that file’s Workbooks.Open call. This keeps the instruction beside the operation it applies to and avoids changing a setting that can affect other workbooks opened by the same Excel session. Restore any application-level settings that a macro does change, especially if an error could interrupt the procedure.
In Excel’s interface, link-management options can vary with the workbook and Excel version. Microsoft 365 for Windows may show a Workbook Links command on the Data tab for supported workbooks; older files or versions may expose link controls differently. Those tools help inspect or manage links, but they are not a replacement for the VBA argument when the specific task is opening a workbook without updating its external workbook references.
Common problems and practical checks
- The workbook opens but a result looks stale: That is expected if the displayed formula depends on an external value that was not refreshed. Confirm whether the saved value is suitable before using it.
- A prompt still appears: Check whether it concerns a password, file access, a format warning, or another data feature.
UpdateLinks:=0only addresses external workbook-link updates. - The path works on one computer only: Use a path available to the computer running Excel. A mapped drive may not be mapped in another user’s session; a suitable shared path may be more reliable.
- The macro cannot run in a browser: Excel for the web can open workbooks but does not run VBA macros. Run the macro in the desktop Excel application.
- You expected links to disappear: They remain in the workbook. If you want to remove external references, that is a different operation and can permanently replace formulas or alter results.
On Mac, the VBA argument is used in the same way, but the file path must follow the path format and locations available to Excel for Mac. The code above uses a Windows-style path and should not be copied unchanged as a Mac path. Excel for the web does not execute VBA, regardless of the argument in the code.
Frequently Asked Questions
What value means do not update links in Workbooks.Open?
Use UpdateLinks:=0. The value 3 requests updates to external references when the workbook opens.
Does UpdateLinks:=0 remove external links?
No. It skips updating them during that open operation. The link formulas and references remain in the workbook, and saved values may still be displayed.
Will UpdateLinks:=0 stop every Excel prompt?
No. It does not suppress prompts for passwords, file access, formats, or unrelated data features. It only specifies what to do about external workbook links during opening.
Can I use this with a workbook opened read-only?
Yes. You can combine UpdateLinks:=0 with ReadOnly:=True in the same Workbooks.Open call. Read-only controls editing; it does not refresh links.
Does the VBA work in Excel for the web or on Mac?
Excel for the web does not run VBA macros. Excel for Mac supports VBA, and the named argument works in the same way, but use a Mac-compatible file path and verify any platform-specific parts of the macro.
Related
- Excel Not Responding? Recover Files and Find Temp Data
- Excel Not Responding in Safe Mode? Causes and Fixes
- Excel Not Responding: Should You Wait or Force Quit?
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- Excel VBA: Keep a UserForm on TopTo keep an Excel VBA UserForm above other windows on Windows, call the Windows API function SetWindowPos with…
- Excel Macro to Pull Data From Other Worksheets SafelyYes. In Excel for Microsoft 365 on Windows, a VBA macro can read ranges from other worksheets and…
- Excel VBA UserForm ListBox: Sorting Options and CodeTo sort a list in an Excel VBA UserForm, sort the values before adding them to the ListBox;…
- How to Create a Word Template With MacrosTo create a Word template that contains a macro, start with a blank document or an existing file,…
- VBA Close Workbook Without a Save PromptTo close an Excel workbook without a save prompt, specify what should happen to unsaved changes: use Workbook.Close…
- VBA Find Method in Excel: Syntax and ExamplesIn Excel VBA, the Range.Find method searches a specified range and returns the first matching cell as a…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.