• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Break links - sheets with charts

freshtomm

Member
Hi guys,

i need to break all links in worksheet, but problem is that some of the sheets contains charts, so normal codes to break links dont work. Is it posibble to break all links both on standard sheets and chart sheets by one code?

Thanks.
 
Mr Freshtomm..

Try this
Code:
Sub BreakLinks()
Dim ExternalLinks As Variant
Dim wb As Workbook
Dim x As Long

Set wb = ActiveWorkbook
  ExternalLinks = wb.LinkSources(Type:=xlLinkTypeExcelLinks)

  For x = 1 To UBound(ExternalLinks)
    wb.BreakLink Name:=ExternalLinks(x), Type:=xlLinkTypeExcelLinks
  Next x
Msgbox "Done"
End Sub
 
Mr Freshtomm..

Try this
Code:
Sub BreakLinks()
Dim ExternalLinks As Variant
Dim wb As Workbook
Dim x As Long

Set wb = ActiveWorkbook
  ExternalLinks = wb.LinkSources(Type:=xlLinkTypeExcelLinks)

  For x = 1 To UBound(ExternalLinks)
    wb.BreakLink Name:=ExternalLinks(x), Type:=xlLinkTypeExcelLinks
  Next x
Msgbox "Done"
End Sub
It works well, thank you very much.
 
Back
Top