Removing phantom external links in Excel

I have an excel spreadsheet with some an external link in that I can't get rid of.

I have read up on the internet quite a lot and Microsoft recommend the following:

  • For references in Cells: Using search and replace for [*] to find all references in worksheet cells.
  • For references in names: Opening up the name manager and making sure there are no external references there.
  • For references in Objects (this is really painful): Select each object individually and look in the formula bar.
  • For references in Charts (also painful): Check the formula bar the title and data series for every chart.

This still leaves me with a phantom external reference that I can't find, so I try some more things

  • The "Data - Edit Links" feature in Excel followed by clicking on "Break link" (nothing happens)
  • Used a "FindLink" plugin (didn't work for me, but was friendly to use)
  • Used Microsoft's DeleteLinks plug in (also didn't work and isn't friendly to use)

For anyone else that's spent hours combing their file, the problem can also exist if you've copied a data validation range over from another workbook.

To fix it :

Ribbon-->File-->Check for Issues-->Check Compatibility

This will bring up the checker that will tell you if Validation points to an external sheet.

Most importantly, it will tell you which sheet it is on.

Anyway once you know the sheet(s), go to the sheet. Now

Ribbon-->Home-->Down arrow next to Find and Select-->Data Validation.

This will select the cells that have Data Validation applied.

Now

Ribbon-->Data-->Data Validation

and fix the broken reference in the "Source" field, or click "Clear All" if you don't need it.


In the end I tracked this down to the conditional formatting rules.

Clicking on "Home - Conditional Formatting - Manage Rules" brings up the following dialog, which is relatively easy to look through and replace the external references.

enter image description here


If the workbook is large is not easy find the format condition with external reference. I write this VBA function for find it. Limited to 80 columns and 500 row for reduce execution time. when function stop you can check the position asking:

 ?foglio.name
 ?cella.row
 ?cella.column

    Public Function CercaLink()
    Dim Cella As Object, i&, Foglio As Object
    For Each Foglio In ActiveWorkbook.Sheets
       ActiveWorkbook.Sheets(Foglio.Name).Select
       For Each Cella In ActiveSheet.Cells
         If Cella.Column < 80 Then
           If Cella.FormatConditions.Count > 0 Then
              For i = 1 To Cella.FormatConditions.Count
                 If InStr(1, Cella.FormatConditions(i).Formula1, ":\") > 0 Then Stop
              Next
           End If
        End If
        If Cella.Row > 500 Then Exit For
     Next
  Next
  End Function