I have a number of workbooks, each with a varying number of links to external workbooks in them. Could somebody help me with the VBA code on how to break all links?
This is from the Excel help file, but only tells how to break one link. I need to have the code break all links (note that there will always be at least 1 link).
This is from the Excel help file, but only tells how to break one link. I need to have the code break all links (note that there will always be at least 1 link).
Code:
Dim astrLinks As Variant
' Define variable as an Excel link type.
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
' Break the first link in the active workbook.
ActiveWorkbook.BreakLink _
Name:=astrLinks(1), _
Type:=xlLinkTypeExcelLinks