Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Gop
 
Posts: n/a
Default BreakLinks method doesn't work.


I've got 2 excel workbooks - lets call them "Data" and "Control" - and
try to break all external links in the Data file from within the
Control file. In the Control file I've created following a function:

Private Function BreakLinks()
aLinks = Workbooks("Data.xls").LinkSources(xlLinkTypeExcelL inks)
If Not IsEmpty(aLinks) Then
For i = 1 To UBound(aLinks)
Workbooks("Data.xls").BreakLink(aLinks(i), xlLinkTypeExcelLinks)
Next i
End If
End Function

This code produces the error message: "Compile error, Expected: =".
When I changed that line to
Workbooks("Data.xls").BreakLink Name:=aLinks(i),
Type:=xlLinkTypeExcelLinks
the compiler didn't report an error, however when I try to execute the
code it comes up with the error: run-time error'1004', Method
'BreakLink' of object '_Workbook' failed"

Any idea what in either case the problem could be?

Thanks in advance...


--
Gop
------------------------------------------------------------------------
Gop's Profile: http://www.excelforum.com/member.php...o&userid=26872
View this thread: http://www.excelforum.com/showthread...hreadid=401093

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
Converting Date to Work Week... PokerZan Excel Discussion (Misc queries) 4 September 1st 05 09:47 PM
Visible rows and functions that work tracy Excel Worksheet Functions 2 August 19th 05 05:25 AM
Tab key don't work in unprotected cells in a protected sheet Chad Excel Discussion (Misc queries) 0 August 16th 05 02:00 AM
Some Excel links don't work Ben Enfield Excel Discussion (Misc queries) 3 August 2nd 05 12:29 AM
Change Path names in copied work book jheaney Excel Worksheet Functions 2 November 18th 04 07:29 PM


All times are GMT +1. The time now is 09:25 PM.

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"