|
-
Jan 17th, 2011, 06:57 AM
#1
Thread Starter
New Member
[RESOLVED] [Excel 2010 VBA] activeworkbook.breaklink
I need help getting activeworkbook.breaklink to work.
I am trying to write a piece of VBA which breaks all the links in workbook (all the links are to a MS-SQL database).
This code:
Code:
Dim objWBConnect As Object
For Each objWBConnect In ActiveWorkbook.Connections
ActiveWorkbook.BreakLink objWBConnect.Name, objWBConnect.Type
Next objWBConnect
Produces the error message:
Method BreakLink of object '_Workbook' failed
Note that objWBConnect.Name & objWBConnect.Type contain valid values (Adjustments & 1 respectively)
-
Jan 17th, 2011, 07:42 AM
#2
Thread Starter
New Member
Re: [Excel 2010 VBA] activeworkbook.breaklink
Solved it myself!
This works:
Code:
Dim objWBConnect As Object
For Each objWBConnect In ActiveWorkbook.Connections
ActiveWorkbook.Connections(objWBConnect.Name).Delete
Next objWBConnect
-
Jan 17th, 2011, 08:30 AM
#3
Re: [Excel 2010 VBA] activeworkbook.breaklink
Excellent, nice job!! Since you resolved your issue can you please mark your thread RESOLVED.
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|