ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pictures.Insert not working correctly in excel 2008. (https://www.excelbanter.com/excel-programming/401428-pictures-insert-not-working-correctly-excel-2008-a.html)

Shashi

Pictures.Insert not working correctly in excel 2008.
 
This code doesnt work correctly in Excel 2008 but works in Excel 2003.

Range("F32").Select
ActiveSheet.Pictures.Insert("T:\Sym-enh\CO\logo.bmp").Select

Picture gets on top of the sheet instead of cell F32.



Ron de Bruin

Pictures.Insert not working correctly in excel 2008.
 
This is a bug

You can use this in 2007 as a workaround

Sub Test()
Dim myPict As Picture

With Range("F32")
Set myPict = .Parent.Pictures.Insert("T:\Sym-enh\CO\logo.bmp")
myPict.Top = .Top
myPict.Left = .Left
End With
End Sub






--

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


"Shashi" wrote in message ...
This code doesnt work correctly in Excel 2008 but works in Excel 2003.

Range("F32").Select
ActiveSheet.Pictures.Insert("T:\Sym-enh\CO\logo.bmp").Select

Picture gets on top of the sheet instead of cell F32.




All times are GMT +1. The time now is 03:36 AM.

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