Fix Excel External Links That Change Row Numbers After Reopening
Question details
Determine why external-link formulas point to different rows after an Excel workbook is saved and reopened.

- 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.
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.
Compare external-link formulas with startup macros disabled
Use this test to determine whether workbook macros are involved in the row changes.
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.
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.
Select each recorded cell and compare its formula in the formula bar with the version recorded before closing. Note any changed row numbers.
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.

Debug Workbook_Open and other startup code
Use this approach when the comparison indicates that macros may be changing the formulas or their source rows.
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.

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.




