Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding out what workbook a file is linked to - Urgent 1

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
[tt]
I was emailed an excel workbook and it says that it's attached to another workbook and then it asks if I want to update it. How can I find out what workbook is attached to it?




Delete * from brain Where MaxLevel = "Full" and reaction = "Slow" order by StartOver
 
If you have xl xp, use CTRL+F and choose "workbook" from the dropdown - then search for *.xls
Other than that, run this:

Sub FindLinks()
For each ws in thisworkbook.worksheets
with .cells
Set c = .Find("*.xls", lookin:=xlformulas)
If Not c Is Nothing Then
firstAddress = c.Address
Do
msgbox "Link found at: " & c.address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
next
end sub


Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
[tt]I have windows xp running office 97

I did not find *.xls and when I ran

Sub FindLinks()
For Each ws In ThisWorkbook.Worksheets
With .Cells
Set c = .Find(&quot;*.xls&quot;, LookIn:=xlFormulas)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox &quot;Link found at: &quot; & c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
Next
End Sub

It gave me an error here = Sub FindLinks() saying:

Invalid or unqualified reference




Delete * from brain Where MaxLevel = &quot;Full&quot; and reaction = &quot;Slow&quot; order by StartOver
 
Apologies - slightly amended version:
Sub FindLinks()
For Each ws In ThisWorkbook.Worksheets
With ws.Cells
Set c = .Find(&quot;*.xls&quot;, LookIn:=xlFormulas)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox &quot;Link found at: sheet:&quot; & ws.Name & &quot; &quot; & c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next
End Sub

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
[tt]thank you very much xlbo.



Delete * from brain Where MaxLevel = &quot;Full&quot; and reaction = &quot;Slow&quot; order by StartOver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top