[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Inserting picture in Excel 2007 using OLE (OpenInsight 32-bit Specific) ====
=== At 25 JAN 2010 01:28:16AM Gordon Heidtman wrote: ===
{{tag>"OpenInsight 32-bit Specific"}}
Good day
I use the following code, using OLE, to insert a bitmap into a Excel 2003 spreadsheet, and it inserts it no problem in the selected cell:
Row=2
j = 1
Col=char(64+j)
CellAddr=$" : Col : "$" : Row
ThisRange=OBJ_EXCEL_RANGE(OXl,CellAddr)
ThisRange-]Select=1
oPictures=oMyActiveSheet-]Pictures
retval=OLECallMethod(oPictures,"Insert",PicFileName)
(The OBJ_EXCEL_RANGE) is a function I use to set the Range)
The problem I have is that when I try to use the same code to write to an Excel 2007 spreadsheet, the bitmap gets inserted at cell B4 regardless of which cell(range) I selected. Thanks, Gordon
----
=== At 27 JAN 2010 03:02AM Eric wrote: ===
http://www.eggheadcafe.com/community/aspnet/66/10034382/excel-2007-vba-for-insert.aspx
tells you that the calls have changed
http://www.exceltip.com/st/Insert_pictures_using_VBA_in_Microsoft_Excel/486.html
tells you some code that works (and the order of the calls)
----
=== At 28 JAN 2010 02:36AM Gordon Heidtman wrote: ===
Thanks for your help Eric. However, I had already managed to determine the new code by recording Macro's and viewing the code. My problem is that I don't know how to translate that code into a valid OI syntax.ie. How would the call method change from the previous format below?
'retval=OLECallMethod(oPictures,"Insert",PicFileName)'
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=F59D86D3A0BBBE4C852576B600238C01|View this thread on the forum...]]