ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inser picture problem (https://www.excelbanter.com/excel-programming/420695-inser-picture-problem.html)

Lincoln Burrows

Inser picture problem
 
Hi,
I have a VFP coding for inserting a Picture to the active work book

loExcelSession.Cells(10,10).Select
loExcelSession.ActiveSheet.Pictures.Insert(lcLogoN ame).Select

In Excel 2007 the picture is not inserted in to correct cell what I
mentioned
But in Excel 2003 there is no any problem like that it is inserted in to
correct cell what I mentioned.
Why does this happens
Pls Help



Ron de Bruin

Inser picture problem
 
Yes that is correct, in 2007 it not work like in 2003

This will work in 2003 and 2007

Dim myPict As Picture

With ActiveSheet.Range("J10")
Set myPict = .Parent.Pictures.Insert(lcLogoName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With



--

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


"Lincoln Burrows" wrote in message ...
Hi,
I have a VFP coding for inserting a Picture to the active work book

loExcelSession.Cells(10,10).Select
loExcelSession.ActiveSheet.Pictures.Insert(lcLogoN ame).Select

In Excel 2007 the picture is not inserted in to correct cell what I
mentioned
But in Excel 2003 there is no any problem like that it is inserted in to
correct cell what I mentioned.
Why does this happens
Pls Help



Lincoln Burrows

Inser picture problem
 
Thanks Ron,
Its working
But is there any way to give the Cell instead of Range

"Ron de Bruin" wrote in message
...
Yes that is correct, in 2007 it not work like in 2003

This will work in 2003 and 2007

Dim myPict As Picture
With ActiveSheet.Range("J10")
Set myPict = .Parent.Pictures.Insert(lcLogoName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With


--

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


"Lincoln Burrows" wrote in message
...
Hi,
I have a VFP coding for inserting a Picture to the active work book

loExcelSession.Cells(10,10).Select
loExcelSession.ActiveSheet.Pictures.Insert(lcLogoN ame).Select

In Excel 2007 the picture is not inserted in to correct cell what I
mentioned
But in Excel 2003 there is no any problem like that it is inserted in to
correct cell what I mentioned.
Why does this happens
Pls Help



Ron de Bruin

Inser picture problem
 
Hi Lincoln

Yes, you can use Cells

With Cells(10, 10)



--

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


"Lincoln Burrows" wrote in message ...
Thanks Ron,
Its working
But is there any way to give the Cell instead of Range

"Ron de Bruin" wrote in message
...
Yes that is correct, in 2007 it not work like in 2003

This will work in 2003 and 2007

Dim myPict As Picture
With ActiveSheet.Range("J10")
Set myPict = .Parent.Pictures.Insert(lcLogoName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With


--

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


"Lincoln Burrows" wrote in message
...
Hi,
I have a VFP coding for inserting a Picture to the active work book

loExcelSession.Cells(10,10).Select
loExcelSession.ActiveSheet.Pictures.Insert(lcLogoN ame).Select

In Excel 2007 the picture is not inserted in to correct cell what I
mentioned
But in Excel 2003 there is no any problem like that it is inserted in to
correct cell what I mentioned.
Why does this happens
Pls Help




All times are GMT +1. The time now is 05:17 AM.

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