Wednesday, April 4, 2018

Excel Hidden Names and External Links that Won't Break

Was getting error messages when opening an excel file (not macro enabled) warning of links to external files and links to what appeared to be sharepoint sites.

Excel wouldn't let me delete the external link via Data>Connections>Edit Links.  The link simply would not delete.

There didn't appear to be any bad references under Name Manager.

Ultimately it turned out to be:

1)  Data Validation which was referencing a list on an external file (the cause of the external link that I couldn't delete).

2)  Hundreds of hidden Names that weren't visible in Name Manager (I suspect the cause of what appeared to be links to sharepoint sites).

Resolving Item 1) Data Validation was cumbersome.  You had to go to each worksheet and had to find any Data Validation.  I did this using HOME>Editing>Find&Select>Go To Special>Find Special>Data Validation (All).  Once I found the range, I went to DATA>Data Tools>Data Validation>Data Validation.... and changed the settings to Allow>Any Value.  I still couldn't delete the external link so I moved on to seeing if there were other areas that could be linking to this external file.

Resolving Item 2) hidden Names.

I finally found a Macro at the following link which then made a TOOONNNNNNNSSSS (I think hundreds) of bad named references visible in the Name Manager  http://professor-excel.com/named-ranges-excel-hidden-names/

Sub unhideAllNames()
'Unhide all names in the currently open Excel file
    For Each tempName In ActiveWorkbook.Names
        tempName.Visible = True
    Next
End Sub


Once I deleted all the hidden Names I was then able to delete the external link.


Another tool I used to hunt down possible issues was FILE>Info>Check for Issues>Inspect Document