‎2005 Dec 06 11:35 AM
Hi,
Anyone who knows how to insert a picture into an <b>excel</b>-sheet via <b>OLE</b>-technique? I managed to get a lot onto my sheet (borders, colors, etc.) but i haven't found how to insert a picture. Thanks a lot in advance!!
Here's the beginning of my code:
CREATE OBJECT application 'excel.application'.
SET PROPERTY OF application 'visible' = 0.
Create workbook
GET PROPERTY OF application 'Workbooks' = workbooks .
CALL METHOD OF workbooks 'Open' = workbook
EXPORTING
#1 = '
***.
Create first Excel Sheet
CALL METHOD OF application 'Worksheets' = sheet
EXPORTING
#1 = 1.
CALL METHOD OF sheet 'Activate'.
SET PROPERTY OF sheet 'Name' = 'Bestelling'.
CALL METHOD OF application 'Cells' = cells
EXPORTING
#1 = i
#2 = j.
SET PROPERTY OF cells 'Value' = val .
GET PROPERTY OF cells 'Font' = h_f.
SET PROPERTY OF h_f 'Bold' = bold .
SET PROPERTY OF h_f 'Italic' = italic.
GET PROPERTY OF cells 'Interior' = interior .
SET PROPERTY OF interior 'ColorIndex' = color .
<b></b>
‎2005 Dec 06 2:33 PM
‎2005 Dec 06 2:39 PM
‎2005 Dec 06 2:54 PM
Insert a picture from a server or c:\-drive,...anywhere. My problem is that i can't insert a picture into Excel via OLE... any solutions?
‎2005 Dec 06 3:46 PM
Hi,
For the activated sheet, create a property on the following and pass the file path/file name to it.
"Pictures.Insert"
Thanks,
‎2005 Dec 06 4:02 PM
Hi Siegfried,
You can use <b>Shape</b> object which is the child of <b>range</b> object. Shape object is a member of <b>shapes</b> collection. Please have a look of <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaxl11/html/xltocOMMap_HV01049651.">Excel Object model</a> for further detail.
‎2005 Dec 06 4:15 PM
Thanks for the replies.
I still haven't managed to solve my problem.
@ Sharad: have you already succesfully inserted a picture in Excel via the 'Shape object'? I have tried it but never came to a good result!!
Maybe someone with some sample code?
‎2005 Dec 15 10:51 AM
Hi,
I solved the problem my own; in fact it was quite simple:
for the interested ones (in my case not using 'Shape Object'):
GET PROPERTY OF gs_sheet 'Pictures' = gs_picture.
CALL METHOD OF gs_picture 'Insert'
EXPORTING
#1 = 'C:\TEMP\Picture.bmp'.
To state the place where the picture has to be inserted just do a select before the insert of the picture.
CALL METHOD OF gs_application 'Range' = gs_cells
EXPORTING
#1 = 'A1'
#2 = 'A2'.
CALL METHOD OF gs_cells 'Select' = select.
‎2009 May 18 9:33 AM
Hi Siegfried,
Can you please help me out with the same code, if you can?
My requirement is to insert an image into the excel using OLE.
I tried using the code you presented with.But its not working.
Request inputs of anyone who were able to solve this
Thanks in adv,
Gary
‎2006 Aug 23 2:00 PM
i want to insert pictures in samrt form
dynayamically way u inserted in excel
‎2008 Nov 24 3:36 AM
But it seems in smartform you could not insert pictures into table lines. And of course you could not transfer smartform table to excel file.....That is unacceptable for the custmor.
‎2008 Nov 24 3:39 AM
‎2008 Nov 24 5:07 AM
‎2009 Mar 21 10:44 AM
Hi Experts,
My requirement si that I need to insert Picture at Bookmark Location in word document.
Bookmark has already been defined in word document which I am opening. Name of bookmark is suppose Sig
The Visual Basic syntax is :
Range = 'doc.Bookmarks("Sig").Range and
In Abap I can write as
GET PROPERTY OF WORD 'ActiveDocument' = doc .
GET PROPERTY OF doc 'Bookmarks' = item.
Now how to proceed. Any ideay ?
Rishi