ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to Insert a picture using VC++ (https://www.excelbanter.com/excel-programming/299790-re-code-insert-picture-using-vc.html)

keepITcool

Code to Insert a picture using VC++
 
dont know 'bout vc++ but in VBA it goes like this:
I've fully declared the types to avoid confusion, the picture object comes
in many libraries.. and in many shapes...

Sub Test()
Dim wks As Excel.Worksheet
Dim pic As Excel.Picture
Dim shp As Excel.Shape

Set wks = ActiveSheet
Set pic = wks.Pictures.Insert("C:\logo.gif")
Set shp = pic.ShapeRange(1)

End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?QmluIEsu?= wrote:

Hi All,
Anybody know how to include a picture in an excel sheet using VC++. I
can use AddPicture but it seems not supported by EXCEL 2003 object
model. Also, is there any way to insert the picture without explicitly
specifying the size of the picture?

Thanks in advance,
Bin




Bin K.

Code to Insert a picture using VC++
 
Hi keepitcool,

Thanks for the reply but that didn't work for me because I'm looking specific to VC++.

Regds,
Bin

----- keepitcool wrote: -----

dont know 'bout vc++ but in VBA it goes like this:
I've fully declared the types to avoid confusion, the picture object comes
in many libraries.. and in many shapes...

Sub Test()
Dim wks As Excel.Worksheet
Dim pic As Excel.Picture
Dim shp As Excel.Shape

Set wks = ActiveSheet
Set pic = wks.Pictures.Insert("C:\logo.gif")
Set shp = pic.ShapeRange(1)

End Sub


keepITcool

< email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool


?B?QmluIEsu?= wrote:

Hi All,
Anybody know how to include a picture in an excel sheet using VC++. I
can use AddPicture but it seems not supported by EXCEL 2003 object
model. Also, is there any way to insert the picture without explicitly
specifying the size of the picture?
Thanks in advance,

Bin



All times are GMT +1. The time now is 02:19 AM.

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