Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Break all links in the workbook


Hello,

IV been trying to break links in excel workbooks by VBA
But I wanted to know how to break all the links in the workbooks, no
just one single link

ActiveWorkbook.BreakLink Name:= _
"\\excel\Portfolios\sample.xls" _
, Type:=xlExcelLinks

This code breaks single link, but is there a code to break them all.

Thanks in advanc

--
striker72sPosted from http://www.pcreview.co.uk/ newsgroup acces

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Break all links in the workbook

Hi there,

The LinkSources method returns an array of links so then it's just a matter
of stepping backwards through each one and deleting them. I'm not sure if
there's a method to delete the "links collection" (can anyone enlighten
me?). Anyway, this seems to do the job.

Best regards

John

Sub BreakAllWorkbookLinks()

aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For i = 1 To UBound(aLinks) Step -1
Debug.Print aLinks(i)
Application.ActiveWorkbook.BreakLink _
Name:=aLinks(i), _
Type:=xlLinkTypeExcelLinks
Next i
End If

End Sub


"striker72s" <striker72s.1rdnry@ wrote in message
...

Hello,

IV been trying to break links in excel workbooks by VBA
But I wanted to know how to break all the links in the workbooks, not
just one single link

ActiveWorkbook.BreakLink Name:= _
"\\excel\Portfolios\sample.xls" _
, Type:=xlExcelLinks

This code breaks single link, but is there a code to break them all.

Thanks in advance


--
striker72sPosted from http://www.pcreview.co.uk/ newsgroup access



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Break internal links doublew Excel Discussion (Misc queries) 3 May 2nd 07 04:42 PM
Break Links Sean Excel Discussion (Misc queries) 1 October 25th 06 03:34 PM
Copy sheet - Break Links to Old Workbook - Retain Formula. Mr Anonymouse Setting up and Configuration of Excel 1 October 15th 05 01:00 AM
How do I break links in a workbook? Alwebster6635 Excel Worksheet Functions 3 July 21st 05 07:26 PM
break links peadar Excel Programming 2 March 22nd 05 12:43 AM


All times are GMT +1. The time now is 05:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"