Identifying embedded object # and location

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have an embedded object in our worksheet at location say D18.
Programmatically, how do we identify what object is at that location. There
may be more than one embedded object on the worksheet so how would we address
that?

Thanks
 
Barb,

You could iterate through all the objects, perhaps, depending on the objects being shapes:

Sub FindD18Shape()
Dim mySh As Shape
For Each mySh In ActiveSheet.Shapes
If mySh.TopLeftCell.Address = "$D$18" Then
GoTo Found:
End If
Next mySh

Found:

MsgBox mySh.Name & " is at " & mySh.TopLeftCell.Address

End Sub

Or you could be more proactive when you insert your objects, and name them when they are inserted,
with names like "objD18"

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top