code not working [message #409809] |
Wed, 24 June 2009 02:56 |
sunil.madnani
Messages: 36 Registered: March 2007 Location: BHILAI
|
Member |
|
|
Hello All,
i want to populate data on specific excel and on specific sheet using ole2 object.
It is going to exception
/****************************************************************
Begin
application OLE2.OBJ_TYPE;
workbooks OLE2.OBJ_TYPE;
workbook OLE2.OBJ_TYPE;
worksheet OLE2.OBJ_TYPE;
cell OLE2.OBJ_TYPE;
FormulaCell OLE2.OBJ_TYPE;
BlankCell OLE2.OBJ_TYPE;
args ole2.OBJ_TYPE;
vCellAddress Varchar2(100);
vFormulaResult Varchar2(100);
IsBlank Varchar2(20);
IsText Varchar2(20);
vValue Varchar2(20);
Begin
application := OLE2.CREATE_OBJ('Excel.Application');
ole2.set_property(application,'Visible','false');
workbooks := OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
args := OLE2.CREATE_ARGLIST;
ole2.add_arg(args,'D:\test.xls');
workbook := ole2.GET_OBJ_PROPERTY(workbooks,'Open',args);
ole2.destroy_arglist(args);
args := OLE2.CREATE_ARGLIST;
ole2.add_arg(args,'Sheet2');
worksheet := ole2.GET_OBJ_PROPERTY(application,'ActiveSheet');
ole2.destroy_arglist(args);
Exception
when others then
srw.Message(50,sqlerrm||'Error in opening Excel file ..!');
End;
Regards;
Sunil Madnani
|
|
|
|