problem inserting pictures in excel 2007 using macro.

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

Guest

Hi
I wrote a macro in excel 2003 which inserts a picture at a range cell
identified in the macro. With excel 2007, it ignores the range identified
and puts the picture in the top left of the work sheet.
Has anyone else run across this problem and found a solution?
dickiebird
 
You can use this in 2007 as a workaround

Sub Test()
Dim myPict As Picture

With ActiveCell
Set myPict = .Parent.Pictures.Insert("C:\Users\Ron\Desktop\New Backup\ron.jpg")
myPict.Top = .Top
myPict.Left = .Left
End With
End Sub
 
Back
Top