Export data to Calc throug OLE2 [message #181619] |
Mon, 10 July 2006 19:41 |
orate
Messages: 16 Registered: September 2005
|
Junior Member |
|
|
I need to export data to OpenOffice Calc trough OLE2.
Searching the Web I only found the code listed below (at this page) and it doesn't work.
Also, in another page, there is a list of code examples about how OpenOffice can be accessed from various languages.
PROCEDURE call_calc IS
xlApp OLE2.OBJ_TYPE;
xframe OLE2.OBJ_TYPE;
xlSheets OLE2.OBJ_TYPE;
arg_list OLE2.LIST_TYPE;
arg_list2 OLE2.LIST_TYPE;
BEGIN
xlApp := OLE2.CREATE_OBJ( 'com.sun.star.ServiceManager');
arg_list := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( arg_list,'com.sun.star.frame.Desktop');
xframe := OLE2.INVOKE_OBJ(xlApp,'createInstance',arg_list);
OLE2.Destroy_Arglist(arg_list);
arg_list := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( arg_list,'private:factory/scalc');
OLE2.ADD_ARG( arg_list,'_blank');
OLE2.ADD_ARG( arg_list,0);
arg_list2 := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG_OBJ(arg_list, arg_list2);
xlSheets := OLE2.INVOKE_OBJ(frame,'loadComponentFromURL',arg_list);
END;
Does anyone have a clue on how to do this?
|
|
|
|