This code give me a "Type Mismatch" error, but I can't figure out the issue. Can anyone see what is mismatched? All this is meant to do is to break all links to other workbooks.
Code:
Sub BreakLinks()
On Error GoTo ErrorHandler
Dim vLinks As Variant
Dim lLink As Long
vLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
If vLinks = vbNullString Then Exit Sub
For lLink = LBound(vLinks) To UBound(vLinks)
ActiveWorkbook.BreakLink _
Name:=vLinks(lLink), _
Type:=xlLinkTypeExcelLinks
Next lLink
ErrorHandler:
MsgBox Err.Description
End Sub