Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ole problem
Sombody know why this code doesn't work ? It fails en the line : cell := ole2.invoke_obj(wk,'Cells',args);
DECLARE
app ole2.obj_type; wbks ole2.obj_type; wbk ole2.obj_type; wks ole2.obj_type; wk ole2.obj_type; cell ole2.obj_type;
args ole2.list_type;
BEGIN
app:=ole2.create_obj('Excel.Application');
ole2.set_property(app,'Visible',1);
wbks := ole2.get_obj_property(app, 'workbooks');
args := ole2.create_arglist;
ole2.add_arg(args,'c:\usr\proh.xls');
wbk:=ole2.invoke_obj(wbks,'open',args);
ole2.destroy_arglist(args);
wk:= ole2.get_obj_property(app,'activesheet');
args := ole2.create_arglist;
ole2.add_arg(args,2);
ole2.add_arg(args,2);
cell:=ole2.invoke_obj(wk,'Cells',args);
ole2.destroy_arglist(args);
ole2.set_property(cell,'value',5);
EXCEPTION
when others then
message('Error: '||to_char(sqlcode)||' '||sqlerrm); message('excep ole: '||ole2.last_exception); message(ole2.last_exception);
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Oct 19 1999 - 13:26:25 CDT