OLE2 error with Forms 4.5 and Excel

From: Gabor Levai <glevai_at_eurotrend.hu>
Date: 1998/01/30
Message-ID: <34D1ED7F.6671_at_eurotrend.hu>#1/1


I have a big problem with embedding Excel into the Forms 4.0 as an OLE object. The communication between the Forms and the Hungarian version of Excel is not working correctly. It is an important problem for my company, so I have to solve it. The hungarian Oracle support was not able to help. I hope I find somebody who knows the problem and, may be, the solution.

Environment:

	Windows NT 4.0 Hungarian, and Windows95 Hungarian
	Developer 1.3.2
	Excel 97 Hungarian

In the form there is an ole-container name SPREADSHEET which contains an Excel file. When I run the form and double click on the container, Excel is coming up, I can change the cells, it goes back to the container correctly.
If I would like to change the cells from the form I use this line:

    spreadsheet.setcell(1,1,1998);

The used procedures:



package body spreadsheet is
  obj_hnd ole2.obj_type;
  --*********************

--* GET_OBJECT_HANDLE *
  --*********************

  function get_object_handle return ole2.obj_type is   begin
    if not forms_ole.server_active('spreadsheet') then
      forms_ole.activate_server('spreadsheet');
      obj_hnd := forms_ole.get_interface_pointer('spreadsheet');
    end if;
    return obj_hnd;
  end;
  --***********

--* SETCELL *

  --***********
  procedure setcell(trow number, col number, val number) is     d ole2.obj_type;
    c ole2.obj_type;
    n number;
    lst ole2.list_type;
  begin
    d := get_object_handle;
    lst := ole2.create_arglist;
    ole2.add_arg(lst,trow);
    ole2.add_arg(lst,col);
    c := ole2.invoke_obj(d,'Cells',lst); -- ERROR !!!!!!!
    ole2.set_property(c,'Value',val);
    ole2.destroy_arglist(lst);
    ole2.release_obj(c);

  end;
end;

At the label ERROR the program produces ORA-305500 error message. The OLE2.LAST_EXCEPTION contains the number 2147614726. The hungarian oracle support suggested using the line

    c := ole2.get_obj_property(d,'Cells',lst); instead of the ERROR labelled line. The error was the same. We tried to translate the word "Cells" and use hungarian word instead, but the error was the same.

We tried the above commands, which has to work without ole container:

application := ole2.create_obj('Excel.Application'); ole2.set_property(application,'Visible','True');

It does'nt work.

Can anybody help?

Gabor Levai Received on Fri Jan 30 1998 - 00:00:00 CET

Original text of this message