Share via

Excel changed link location

Ben Mawson 0 Reputation points
2026-04-08T14:11:00.0266667+00:00

I have a workbook with hundreds of links. Recently Excel changed all of these links to read from C:\user\myname\roaming.........andonandon. The file names are the same but as the files don't exist in this location, this broken all the links.

My question is how do I change the source data back to the original in 1 batch?

If this can't be done, how do I charge Microsoft for the time this takes to change each link individually? Deadly serious - Microsoft need to answer this

This has happened because I cannot work online, either Onedrive or sharepoint. This means autosave is off for my workbook saved on my laptop hard drive. I recently turn off autosave to onedrive and set-up to save my files elsewhere just in case Excel crashes (which it does, often, and cause all kinds of version control issues in the recovered files). This SHOULD NOT HAVE CHANGED MY SOURCE LINKS: THIS IS VERY POOR THINKING FROM MICROSOFT

There is no practical reason for this but a commercial decision by Microsoft to force all users onto onedrive. i.e. Microsoft caused this and the time taken for me to fix is a cost to my business. One drive is not feasible for my business, why should I receive less functionality. One way does not fit all and it is extremely poor business sense to assume this.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. Marcin Policht 85,255 Reputation points MVP Volunteer Moderator
    2026-04-08T14:28:38.7966667+00:00

    What you’re seeing is Excel rewriting links to a different base path, usually after a change in how the file was opened, saved, or cached locally (especially with anything that touched OneDrive/Office “recent files” or AutoSave behavior). It’s not intended to “force” anything, but it can break large models like yours, and fixing it one-by-one would be unreasonable. You can fix this in batch and repoint all external links at once.

    Open your workbook, go to Data → Edit Links (this only appears if Excel detects external links). In that window you’ll see a list of all linked source files. Select one, then use “Change Source” and point it to the correct file location. If multiple links point to the same incorrect base path, you can select multiple entries and change them together. If all links share the same structure and only the root folder changed, Excel will often update all matching links automatically once you point one correctly.

    If Excel doesn’t group them properly, try Find and Replace on the formulas themselves. Press Ctrl+H, then search for the incorrect path fragment like:

    C:\Users\myname\AppData\Roaming\...
    

    and replace it with the correct base path, for example:

    D:\YourActualFolder\...
    

    Make sure “Look in: Formulas” is selected, then replace all. This updates hundreds of links in one pass.

    If some links are defined names instead of direct formulas, go to Formulas → Name Manager and apply the same idea there, either manually or using the same replace approach if you copy them into a temporary sheet.

    If the links are embedded in Power Query connections, go to Data → Queries & Connections, open each query, and update the source path in Advanced Editor. If many queries share the same root, you can copy one corrected M expression across them.

    If you want something more controlled, a short VBA script can rewrite every external reference in seconds:

    Sub FixLinks()
        Dim ws As Worksheet
        Dim c As Range
        Dim oldPath As String
        Dim newPath As String
    
        oldPath = "C:\Users\myname\AppData\Roaming\..."
        newPath = "D:\YourActualFolder\..."
    
        For Each ws In ThisWorkbook.Worksheets
            For Each c In ws.UsedRange
                If c.HasFormula Then
                    c.Formula = Replace(c.Formula, oldPath, newPath)
                End If
            Next c
        Next ws
    End Sub
    

    Run that once and it will sweep the entire workbook.

    On the “charging Microsoft” point, you can either raise a support ticket (if you have a business or enterprise license), report this through Excel’s feedback channel, or restore a previous version of the workbook if you have backups.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.