Killing External links

jcaulfield

Board Regular
Joined
Nov 23, 2012
Messages
50
I have Excel 2016. Occasionally I have a difficult time breaking external links. My process is as follows: Data - Edit Link - Break link. If link is not broken then I delete any "named" ranges referencing an external files, and then Data - Edit Link - Break link again. Most of the time this works, but sometimes I can not find and break link. I even search Macros for any external links without success. Thoughts?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Does this help?
Code:
Sub BreakExternalLinks()
    Dim ExternalLinks As Variant, x As Long
    
    With ActiveWorkbook
        On Error Resume Next
           ExternalLinks = .LinkSources(Type:=xlLinkTypeExcelLinks)
        On Error GoTo Handling
            For x = 1 To UBound(ExternalLinks)
                .BreakLink Name:=ExternalLinks(x), Type:=xlLinkTypeExcelLinks
            Next x
    End With
Handling:
End Sub

Original source of code (now modified) was www.TheSpreadsheetGuru.com/The-Code-Vault
 
Upvote 0
Halleluja,

This actually worked for me just now. I've been struggling with breaking links from old files forever.

Going to keep this code in my personal workbook.
 
Upvote 0
Thanks Yongle. I had a similar issue and I couldn't find any links in the usual places (range names, object values, data validation, I had no charts). But using your code resolved my issue in a second. I don't know where it found the links, but I can see if I can find them at a later date for my own sanity.
 
Upvote 0
@Seti - glad the code also fixed your problem

I don't know where it found the links, but I can see if I can find them at a later date for my own sanity

Sometimes the cause of the issue cannot be determined
- I have experienced phantom links (Excel hanging onto the memory of a link that is categorically not in the workbook) .... perhaps a minor corruption or whatever!

Have you checked for links in
- shapes
- formulas in conditional formatting rules
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top