Database data to excel using OLE [message #212827] |
Mon, 08 January 2007 08:22 |
srinivas.k2005
Messages: 404 Registered: August 2006
|
Senior Member |
|
|
Hi,
I am using OLE in forms in a button,when we click on the button the excel report opens and data get generated in the excel report ,but the data i get goes to Sheet4 creating a new sheet.But i want the data to be in the existing Sheet1 of the excel report.
In default in excel report we will have sheet1,sheet2 and sheet3.
I am using the following code:
BEGIN
Myapplication := Ole2.Create_Obj('Excel.Application');
Ole2.Set_Property(Myapplication , 'Visible',1);
Wbs := Ole2.Get_Obj_Property(Myapplication ,'Workbooks');
Wb := Ole2.Invoke_Obj(Wbs,'Add');
Worksheets := Ole2.Get_Obj_Property(Wb, 'Worksheets');
Wss := Ole2.Invoke_Obj(Worksheets,'Add');
END;
Is there anything that can populate data in existing sheet only.
if i remove the code:
Wb := Ole2.Invoke_Obj(Wbs,'Add');
i get error,is there anything that can replace the inbuilt 'Add'
Thanks,
Srinivas.
|
|
|
|