VBA & Macro Problems

Fix Excel External Links That Change Row Numbers After Reopening

Maira MehtabMaira Mehtab Nov 20, 2026 869 views

Question details

Determine why external-link formulas point to different rows after an Excel workbook is saved and reopened.

Fix Excel External Links That Change Row Numbers After Reopening
Product
Microsoft Excel
Device & OS
not provided
Scenario
A workbook contains external links and may run a Workbook_Open macro when opened.
Observed behavior
External-link formulas refer to different row numbers after the workbook is saved, closed, and reopened.
Before you start

Identify a few affected cells and record their complete formulas from the formula bar before closing the workbook. Note whether you update external links when opening it, and use the same link-update choice during comparison tests.

Solution 1Recommended

Compare external-link formulas with startup macros disabled

Use this test to determine whether workbook macros are involved in the row changes.

1
Set macro notifications

In Excel, open File > Options > Trust Center > Trust Center Settings > Macro Settings and select the option to disable VBA macros with notification. The wording may vary by version.

2
Reopen without macros

Close and reopen the affected workbook. If a security warning appears, do not select Enable Content. Make the same choice about updating external links as in your original test.

3
Compare formulas

Select each recorded cell and compare its formula in the formula bar with the version recorded before closing. Note any changed row numbers.

4
Compare with macros enabled

If you trust the workbook, reopen it with macros enabled and repeat the comparison using the same external-link update choice. If the change occurs only with macros enabled, investigate the startup code.

Compare external-link formulas with startup macros disabled
Interpret the result: A change with macros disabled calls for further investigation of link updates or changes in the source workbook. Restore your preferred macro-security setting after testing.
Free Microsoft Office alternative

Work with spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with spreadsheet files. Its Excel format compatibility can make migration easier, although it does not debug or repair Excel's VBA startup behavior.

Review spreadsheet formulas in a familiar interfaceOpen and edit Microsoft Excel XLSX and XLS filesUse a free, lightweight office suiteMove existing Office documents into a familiar workspace
microsoft office alternative - wps office

Frequently Asked Questions

Can a Workbook_Open macro change external-link row numbers?

Yes. Code that moves, inserts, deletes, or sorts rows, updates links, or rewrites formulas can affect references. Press Alt+F11 and inspect Workbook_Open in ThisWorkbook and any procedures it calls.

How can I check whether macros are causing the change?

Record the affected formulas, reopen the workbook without enabling macros, and compare them in the formula bar. Repeat with macros enabled only if you trust the workbook, keeping the external-link update choice consistent.

What if the formulas change even when macros are disabled?

Check your choice when Excel asks whether to update external links and examine whether rows in the source workbook were inserted, deleted, moved, or sorted. Compare the full formulas before and after reopening.

How do I step through code that runs when the workbook opens?

In the VBA editor, add a temporary Stop statement near the start of the trusted startup procedure. Save and reopen the workbook with macros enabled, then use F8 to step through the code. Remove the Stop statement after testing.