Can't figure it out


Posted by Michael on December 20, 2001 7:26 AM

How do I find what workbooks my active workbook has call-outs to? It is trying to find a workbook that was deleted a while ago, and as far as I can tell, there is no direct link between the two. So, how do I find where this supposed call-out is?



Posted by sandra on December 20, 2001 8:19 AM

Hi Michael

Do you mean that there is a broken link to another non exist workbook in your workbook ?

You can use the following macro:
Sub CheckLink()
On Error GoTo 99
Cells.Find(What:="#REF", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate

On Error GoTo 99
firstAddress = ActiveCell.Address

lbl_loop: If InStr(ActiveCell.Formula, ".xls") > 0 Then _
MsgBox ActiveCell.Address & " has a link to another non exist workbook"

Cells.FindNext(After:=ActiveCell).Activate

If ActiveCell.Address <> firstAddress Then
GoTo lbl_loop
Else
GoTo 99
End If

99 MsgBox "End search"
End Sub

I hope it will help finding a broken link