I need to search for external links in a workbook using VBA.
I was thinking of doing it along the lines of:
This works if an external link exists, but if no links are found I get the following error message:
Run-time error '91':
Object variable or With block variable not set
How can I achieve what I want?
/Soren
I was thinking of doing it along the lines of:
Code:
If Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False).Activate Then
MsgBox "External Link found!"
Else
MsgBox "No external links found!"
End if
This works if an external link exists, but if no links are found I get the following error message:
Run-time error '91':
Object variable or With block variable not set
How can I achieve what I want?
/Soren