Hi All,
I want to know how can I completely remove all the external links from a workbook. In Excel 2010 and 2013, Menu bar >> Data tab >> Edit Links, here I can see "Break Links" option to disconnect external links/files, and this method can also be done by VBA program:
Removing external links in Excel:
Sub RemoveLinks()
' Code 1 - http://p2p.wrox.com/excel-vba/9625-removing-external-links-excel.html
Dim Link As Variant
For Each Link In ActiveWorkbook.LinkSources
MsgBox Link
ActiveWorkbook.BreakLink Name:=Link, Type:=xlLinkTypeExcelLinks
ActiveWorkbook.BreakLink Name:=Link, Type:=xlLinkTypeExcelLinks
Next
End Sub
'----------------------------------------------------------------------------------------
Sub BreakAllLinks()
' Code 2 - http://mydailymicrosoft.blogspot.in/2012/06/vba-break-all-external-links-in.html
Dim arrStrLinks As Variant
' Read workbook links to an array.
arrStrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
' Loop through whole array -> all links.
For i = 1 To UBound(arrStrLinks)
ActiveWorkbook.BreakLink _
Name:=arrStrLinks(i), _
Type:=xlLinkTypeExcelLinks
Next i
End Sub
Now what I am actually looking at is... something like this - XL: Delete Links Wizard Available - http://support.microsoft.com/kb/188449
I have checked this add-in tool, but it does not work for "*.xlsx" and ".xlsm" files.
Break Links method only disconnect from the links, and I also want to remove the displayed broken links, so the "Edit Links" window/information box should be blank.
Please help me!
Thanks & Regards,
SunOffice
Bookmarks