Kevin Boyd
Kevin Boyd

Reputation: 12379

How to find co-ordinates or Cell of picture object?

In Excel I have attached a picture to a cell using the following

Sub InsertPic()
    Dim mPic As Picture
    With ActiveSheet.Range("D12")
         Set mPic = .Parent.Pictures.Insert("C:\abc.png")
         mPic.Top = .Top
         mPic.Left = .Left
         mPic.Placement = xlMoveAndSize
     End With
 End Sub

Excel doesn't allow inserting pictures into cells but places it on it or attaches to it.

At run-time I need to find which Cell the picture is associated to, is this possible?

Upvotes: 2

Views: 3291

Answers (1)

GSerg
GSerg

Reputation: 78190

Use the .TopLeftCell property.

Upvotes: 5

Related Questions