ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   break excel links (https://www.excelbanter.com/excel-programming/333465-break-excel-links.html)

striker72s[_2_]

break excel links
 

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

--
striker72
-----------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...fo&userid=2486
View this thread: http://www.excelforum.com/showthread.php?threadid=38406


Ron de Bruin

break excel links
 
Hi striker72s

You can run this macro also to make text of all hyperlinks
in your worksheet

Sub test()
ActiveSheet.Hyperlinks.Delete
End Sub

Alt-F11
InsertModule from the menubar
paste the sub in there
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "test" and press Run


--
Regards Ron de Bruin
http://www.rondebruin.nl


"striker72s" 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


--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061




striker72s[_3_]

break excel links
 

iv tryed it , the datalinks didnt break ??

ActiveSheet.Hyperlinks.Delete


--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061


Dave Peterson[_5_]

break excel links
 
I stole the code from VBA's help and modified it to go through all the links:

Option Explicit
Sub UseBreakLink2()

Dim astrLinks As Variant
Dim iCtr As Long

astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLi nks)

If IsArray(astrLinks) Then
For iCtr = LBound(astrLinks) To UBound(astrLinks)
ActiveWorkbook.BreakLink Name:=astrLinks(iCtr), _
Type:=xlLinkTypeExcelLinks
Next iCtr
End If

End Sub



striker72s wrote:

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

--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061


--

Dave Peterson

Dave Peterson[_5_]

break excel links
 
Ron guessed that you were writing about hyperlinks--not links to other
workbooks.


striker72s wrote:

iv tryed it , the datalinks didnt break ??

ActiveSheet.Hyperlinks.Delete

--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061


--

Dave Peterson

Dave Peterson[_5_]

break excel links
 
ps. If you want to see the stuff with the links and decide later to break them
(or not)...

Use Bill Manville's FindLink program:
http://www.oaltd.co.uk/MVP/Default.htm

striker72s wrote:

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

--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061


--

Dave Peterson

Ron de Bruin

break excel links
 
Thanks Dave

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dave Peterson" wrote in message ...
Ron guessed that you were writing about hyperlinks--not links to other
workbooks.


striker72s wrote:

iv tryed it , the datalinks didnt break ??

ActiveSheet.Hyperlinks.Delete

--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061


--

Dave Peterson




striker72s[_4_]

break excel links
 

Dave, iv tried the code and it worked,
Thanks a lot guys for the help. Now, ill try to transform it to C# ;)


--
striker72s
------------------------------------------------------------------------
striker72s's Profile: http://www.excelforum.com/member.php...o&userid=24862
View this thread: http://www.excelforum.com/showthread...hreadid=384061



All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com