Find External Links in an Excel File

Find External Links in an Excel File

Last week, I opened an Excel file, and was surprised to see a Security Warning. Apparently there were external links in the file, and I didn’t want to keep them. Here’s how you can find external links in an Excel file.

This screen shot shows the warning that I saw, when I opened the file.

externallinks01

To look for the links, you can use a free add-in – there is a link at the end of this article. Or, go through the file yourself, and try to fix the links.

The Manual Fix

For reasons that I can’t remember I decided to to a manual search for the links. First, I made a backup copy of the file – just in case things went wrong. Not that anything ever goes wrong in Excel!

Then, I opened the file again, clicked the Enable Content button, and started my search for those unwanted links.

Look in the Formulas

The first place I looked was in the workbook’s formulas. Maybe I had copied a formula from another workbook, and it was still linking back to that file. If that file is referenced in a formula, its name is enclosed in square brackets, so I used the Find command to look for those.

When I clicked the Find All button, Excel showed me a list of 18 cells that had square brackets. I clicked on the first item, and it had a reference to another file, so I’ll be able to fix that.

There were other cells with square brackets that aren’t external links, so I ignored those. Excel table references use square brackets too, like this formula:

=[@Amt]*0.07

externallinks02

It might be easier to search for “.xls” now, if the workbook has formatted tables.

Fix the Formulas

The formula that I want to fix is looking up prices in another workbook’s pricing table.

=VLOOKUP(C2,’D:\BlogCtx\TestFiles\[DateAmts.xlsx]Prices’!$B$2:$C$5,2,FALSE)

I wanted to get rid of the links, and change those cells to values, so I followed these steps, to break those links:

  • On the Ribbon, click the Data tab
  • In the Connections group, click Edit Links
  • Select the link that you want to break, and click Break Link.
  • A warning message will appear, so read it carefully – especially the part about making a backup copy. Then, click Break Links if you’re sure that’s what you want to do.

externallinks03

Unfortunately, that didn’t change anything – the links were still in the formula.

Copy and Paste As Values

The cells were all in one column in a table, so I decided to change them to values by copying them, then pasting as values.

That got rid of the link in those cells – now they just contain numbers, not links.

externallinks04

The Edit Links window was still showing a link to that workbook though, so maybe one of the workbook names had been copied too.

Check the Names List

To see then names, click the Formulas tab on the Ribbon, then click Name Manager. In the Refers To column, you might see references to other workbooks. You can delete those names, or change them, so they refer to ranges in the active workbook.

I didn’t need the Product name or LocationList (I hope!), so I deleted them. I’ll check on the LocationList name later.

externallinks05

When I checked the Edit Links window again, the link to the DateAmts.xlsx file was gone. Hooray!

However, there was still a link to another workbook – PartLocDBCombo.xls. I had deleted the LocationList, which referred to that workbook, so where could that link be?

Check the Buttons

Another place that links can hide is in the macros that are assigned to buttons. This workbook had 2 buttons, so I checked those next.

I right-clicked on the first button, and clicked Assign Macro, to see the macro that the button runs. In this example, it was still trying to run the macro in the PartLocDBCombo.xls workbook.

So, I selected a macro in the current workbook, for each button, to get rid of those links.

externallinks06

Close and Reopen the File

The Edit Links window still showed a link to PartLocDBCombo.xls, but I didn’t know of any other places to look. So, I saved the workbook, then closed and reopened it, and that got rid of the “ghost” link.

It can be a slow and frustrating process to remove external links, so be careful what you copy into a workbook!

Use the Find Link Add-in

For an automated way of checking for links, you can download Bill Manville’s free FINDLINK.XLA program, from his website.

After you install the add-in, it will appear as a menu item on the Ribbon’s Add-Ins tab. Click the Find Links command, to open the Link Finder window.

Select a file name from the drop down list, then select one of the options for working with those links.

externallinks07

Links Hidden in Other Places

Read the comments below, to see some other places that people have found links in their Excel files. For example:

Also, see Rag’s comment with steps for finding error cells in Excel 2013.
______________________

34 thoughts on “Find External Links in an Excel File”

  1. ALSO DATA VALIDATION ENTRIES
    You should add to this list to look for Data Validation entries. This has caught me out a few times.

  2. Probably should be a new thread, but will try here first as it is related to the orig question.
    I have a workbook (call it oldfile.xlsm) with conditional formatting which references another tab ( e.g. call it “Lookups”) in the same oldfile.xlsm workbook.
    When I copy the entire sheet into another workbook, I want the conditional formatting in the new workbook to just refer to the “Lookups” tab in the new workbook. However, just now it converts the ref into e.g. [oldfile.xlsm]Lookups/
    How do I stop it adding in the name of the original workbook when I paste the sheet ?

    1. In workbook A, can you name the ranges on the Lookups sheet, then refer to those ranges in the conditional formatting?
      Have ranges with the same names set up in workbook B.
      Then, when you copy the sheet to workbook B, go to the Data tab and click Edit Links
      Click “Change Source”, and select workbook B.
      Then, go to the Formulas tab, and open the Name Manager.
      Delete the worksheet level names on the imported sheet.

  3. Thanks so much for the info and the COMMENTS! This is the only site I found this info on – especially Rag’s guide.

  4. Just to add something else to the list of strange places to find External Links. I had an external link behind a merged cell.
    F27 & G27 were merged, so only the value in F27 was visible. When I unmerged the cells there was an external link in G27 which was not visible. No idea how it got there.

  5. Pingback: How to Find External Links and References in Excel
  6. Excellent article. More detailed than any other article I saw before this on. Finally eliminated links when deleting unneeded names in the names list. Thanks. Will keep you information as the first source to go to.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.