Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Breaking links in a macro

Is there a command to break all links at once? I have 70 spreadsheets and
need to open, save as, and break a dozen links and the links are different in
each one. I would rather not have to edit the names of all the links if there
is an easier way. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Breaking links in a macro

Hi,

the easiest way to break links to another excel file:

Sub BreakLinks()
Dim varLinks As Variant
varLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLi nks)
On Error Resume Next
Do
ActiveWorkbook.BreakLink _
Name:=varLinks(1), _
Type:=xlLinkTypeExcelLinks
Loop While Err = 0
End Sub

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Breaking links in a macro

Sub UseBreakLink()

Dim astrLinks As Variant

' Define variable as an Excel link type.
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLi nks)

' Break the first link in the active workbook.
for i = lbound(astrlinks) to ubound(astrlinks)
ActiveWorkbook.BreakLink _
Name:=astrLinks(i), _
Type:=xlLinkTypeExcelLinks
Next i

End Sub


--
Regards,
Tom Ogilvy


"Tim G." wrote:

Is there a command to break all links at once? I have 70 spreadsheets and
need to open, save as, and break a dozen links and the links are different in
each one. I would rather not have to edit the names of all the links if there
is an easier way. Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Breaking links in a macro

Just some added info:
Breaklink was introduced in xl2002 or xl2003 - I don't recall which.

--
Regards,
Tom Ogilvy


"Tim G." wrote:

Is there a command to break all links at once? I have 70 spreadsheets and
need to open, save as, and break a dozen links and the links are different in
each one. I would rather not have to edit the names of all the links if there
is an easier way. Thanks!

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
breaking links Pammy Excel Discussion (Misc queries) 1 September 20th 07 05:58 PM
Breaking Links Krandall Excel Worksheet Functions 0 March 6th 07 02:40 PM
Breaking Links thelees Excel Discussion (Misc queries) 1 September 24th 05 07:11 PM
Breaking Links tojo107 Excel Discussion (Misc queries) 2 July 20th 05 05:40 AM
Breaking links Roger Links and Linking in Excel 2 July 8th 05 02:54 AM


All times are GMT +1. The time now is 01:17 AM.

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

About Us

"It's about Microsoft Excel"