[Migrated content. Thread originally posted on 06 April 2004]
Sorry. I want to display an image from a file
Thanks
You don't specify in what context, Excel is wast and has a myriad of opportunities when it comes to display images...
At any rate, you need to position the image somewhere, which means it needs a place holder.
May I suggest you create a graph. This allows you to specify size and appearance. Then use the method SetBackGroundPicture for this. Like:
CREATE Application OF Excel
HANDLE IN oXL.
MODIFY oXL @Visible = 1.
MODIFY oXL Workbooks::Add()
GIVING oBook.
INQUIRE oBook Worksheets::Item(1) IN
oSheet.
MODIFY oSheet ChartObjects()
GIVING oChartObjects.
MODIFY oChartObjects Add(100, 100, 300, 200)
GIVING oChartObject.
INQUIRE oChartObject Chart::SetBackGroundPicture(
"smiley.jpg").
[Migrated content. Thread originally posted on 06 April 2004]
Sorry. I want to display an image from a file
Thanks
Thanks for your aid, have served to me as much, although in the end I have made it thus:
create application of excel handle in hexcelapp
modify hexcelapp @SheetsInNewWorkBook = 1
modify hexcelapp workbooks::add() giving hexcellibro
inquire hexcellibro worksheets::item(1) in hexcelhoja
modify hexcelhoja Pictures() giving hexcelpictures.
modify hexcelpictures insert("c:\\iconta00\\infco.bmp")
giving hexcelpicture.
modify hexcelpicture @height = 150.
modify hexcelpicture @width = 285.
modify hexcelapp @visible = 1
destroy hexcelhoja
destroy hexcellibro
destroy hexcelapp
[Migrated content. Thread originally posted on 06 April 2004]
Sorry. I want to display an image from a file
Thanks
Thanks for your aid, have served to me as much, although in the end I have made it thus:
create application of excel handle in hexcelapp
modify hexcelapp @SheetsInNewWorkBook = 1
modify hexcelapp workbooks::add() giving hexcellibro
inquire hexcellibro worksheets::item(1) in hexcelhoja
modify hexcelhoja Pictures() giving hexcelpictures.
modify hexcelpictures insert("c:\\iconta00\\infco.bmp")
giving hexcelpicture.
modify hexcelpicture @height = 150.
modify hexcelpicture @width = 285.
modify hexcelapp @visible = 1
destroy hexcelhoja
destroy hexcellibro
destroy hexcelapp
[Migrated content. Thread originally posted on 06 April 2004]
Sorry. I want to display an image from a file
Thanks
Thanks for your aid, have served to me as much, although in the end I have made it thus:
create application of excel handle in hexcelapp
modify hexcelapp @SheetsInNewWorkBook = 1
modify hexcelapp workbooks::add() giving hexcellibro
inquire hexcellibro worksheets::item(1) in hexcelhoja
modify hexcelhoja Pictures() giving hexcelpictures.
modify hexcelpictures insert("c:\\iconta00\\infco.bmp")
giving hexcelpicture.
modify hexcelpicture @height = 150.
modify hexcelpicture @width = 285.
modify hexcelapp @visible = 1
destroy hexcelhoja
destroy hexcellibro
destroy hexcelapp
[Migrated content. Thread originally posted on 06 April 2004]
Sorry. I want to display an image from a file
Thanks
Very nice approach indeed.
One thing I notice here, it is perhaps not so important for you, but I know others has been requesting the opportunity to load a file and get a picture object as returned from vb LoadPicture which then gives the IPicture object.
I am not 110% positive of this, it might be a name clash, but it seems to me, that by using the Pictures class, load a picture and then request this picture from the pictures class by using the Item method, you should be able to get an IPicture object that you may use with objects demanding this.
Now, having said that, using Excel for this may be a bit overkill ;-)