OLE2 ==> Excel97 ==> Dr. Watson???
From: Bert Vanderstraeten <bvds_at_hotpop.com>
Date: Thu, 1 Jul 1999 01:21:38 +0200
Message-ID: <7le8us$gu$1_at_news1.skynet.be>
Hi, this code loads table names into a cursor and fills them into an Excel sheet. Everything runs well untill the excel sheet is closed. This action brings up Dr.Watson with some exception error. My guess is it must be one of the Object_releases. The error however does not appear when the loop is left out.
rownumber NUMBER:=1;
Date: Thu, 1 Jul 1999 01:21:38 +0200
Message-ID: <7le8us$gu$1_at_news1.skynet.be>
Hi, this code loads table names into a cursor and fills them into an Excel sheet. Everything runs well untill the excel sheet is closed. This action brings up Dr.Watson with some exception error. My guess is it must be one of the Object_releases. The error however does not appear when the loop is left out.
Any bright ideas anyone?
Thx a million!
Bert Vanderstraeten
DECLARE
application OLE2.OBJ_TYPE; workbooks OLE2.OBJ_TYPE; workbook OLE2.OBJ_TYPE; worksheets OLE2.OBJ_TYPE; worksheet OLE2.OBJ_TYPE; cell OLE2.OBJ_TYPE; args OLE2.LIST_TYPE;
rownumber NUMBER:=1;
CURSOR c_tables IS select table_name from user_tables;
BEGIN
- Start Excel and make visible -- application:=OLE2.CREATE_OBJ('Excel.Application'); ole2.set_property(application,'Visible',TRUE);
workbooks:=OLE2.GET_OBJ_PROPERTY(application,'Workbooks'); workbook:=OLE2.INVOKE_OBJ(workbooks,'Add'); worksheets:=OLE2.GET_OBJ_PROPERTY(workbook,'Worksheets'); worksheet:=OLE2.INVOKE_OBJ(worksheets,'Add');
for record in c_tables loop
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args,rownumber);
OLE2.ADD_ARG(args,3);
cell:=OLE2.GET_OBJ_PROPERTY(worksheet,'Cells',args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(cell,'Value',record.table_name);
rownumber:=rownumber+1;
end loop;
OLE2.RELEASE_OBJ(cell); OLE2.RELEASE_OBJ(worksheet); OLE2.RELEASE_OBJ(worksheets); OLE2.RELEASE_OBJ(workbook); OLE2.RELEASE_OBJ(workbooks); OLE2.RELEASE_OBJ(application);
END; Received on Thu Jul 01 1999 - 01:21:38 CEST