[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)
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
Re: [Excel 2010 VBA] activeworkbook.breaklink
Excellent, nice job!! Since you resolved your issue can you please mark your thread RESOLVED.