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.开发者_如何学JAVARange("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?
Use the .TopLeftCell
property.
精彩评论