ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem inserting pictures in excel 2007 using macro. (https://www.excelbanter.com/excel-programming/394109-problem-inserting-pictures-excel-2007-using-macro.html)

dickiebird

problem inserting pictures in excel 2007 using macro.
 
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


Ron de Bruin

problem inserting pictures in excel 2007 using macro.
 
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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"dickiebird" wrote in message ...
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



All times are GMT +1. The time now is 12:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com