How to Load Image into Excel sheet purticular Cell?

Posted by sridevi.stalin on 13-Feb-2008 04:39

Dear Friends,

in Progress9.1D,

I could insert image into Excel sheet using the following code,

DEFINE VARIABLE chPicture AS COM-HANDLE NO-UNDO.

chPicture = chWorksheet:Pictures:INSERT("D:\HRMS\AppSrv\sys\src\adm2\image\ggg.jpg":U,).

but I want that image into purticular cell of excel sheet.

like:- chWorkSheet:Range("D" + string(icntr)):Value = "Here the Image"

and, I've Progress table "Images" filed "ImageData" as RAW.

I tried this using LOAD-IMAGE, LOAD-PICTURE..., and Dynamic frame, image.

when I using dynamics, it shows "TRUE" in the cell. means picture has been found.

I couldn't see picture.

need help.

All Replies

Posted by jtownsen on 14-Feb-2008 04:44

I may be completely wrong here, but I don't think you can place pictures into a cell in excel. The top left corner of the selected cell will be the top left corner of the inserted picture. Perhaps you could locate the cursor to the right cell before doing your normal chWorksheet:Pictures:INSERT("...")??

Posted by sridevi.stalin on 14-Feb-2008 23:30

Thing is that,

  1. We can insert “DB-Table-field value (any data type)” into particular cell of Excel sheet.
  2. I’ve the field “DB-‘images’Table-field’ImageData’ (as RAW data type)”.
  3. Now I could report the RAW of imageData again into image on two widgets “button or image” with frame.
  4. Is there any way that is I would like to see the image again in my desired cell of excel sheet?

Example, chXlsSheet:Range(“B3”):Value = “EmployeePhoto”.

here I've used "Range/Value"-method to select the particular cell.

Posted by jtownsen on 15-Feb-2008 03:10

Does this do something like what you're looking for?

DEFINE VARIABLE chExcel AS COM-HANDLE.

CREATE "Excel.Application" chExcel.

chExcel:Workbooks:ADD().

chExcel:Visible = TRUE.

chExcel:Range("C7"):Select.

chExcel:ActiveSheet:Pictures:Insert("C:\temp\myImage.wmf"):Select.

Posted by sridevi.stalin on 15-Feb-2008 04:59

Wow, Thank you very much . Its working!

Message was edited by:

Sridevi Stalin

Posted by Admin on 06-Jul-2008 17:18

Posted by jtownsen on 07-Jul-2008 01:42

The code above simply starts Excel, creates a new spreadsheet and ready a picture from the filesystem, placing it in the cell C7. Assuming you have an OpenEdge development license and Excel installed, you should be able to just paste a copy of the code into the procedure editor and run it.

Posted by Admin on 07-Jul-2008 13:17

eek, what is a 'OpenEdge development license' is there an easier way of inserting a picture into a cell?

Thanks for your patients

Posted by Thomas Mercer-Hursh on 07-Jul-2008 13:33

This thread is closed