Inserting picture in Excel 2007 using OLE (OpenInsight 32-bit Specific)
At 25 JAN 2010 01:28:16AM Gordon Heidtman wrote:
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=2j = 1Col=char(64+j)CellAddr=$" : Col : "$" : RowThisRange=OBJ_EXCEL_RANGE(OXl,CellAddr)ThisRange-]Select=1oPictures=oMyActiveSheet-]Picturesretval=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)'