Home » Developer & Programmer » Forms » Database data to excel using OLE
Database data to excel using OLE [message #212827] Mon, 08 January 2007 08:22 Go to next message
srinivas.k2005
Messages: 334
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.
Re: Database data to excel using OLE [message #213217 is a reply to message #212827] Tue, 09 January 2007 18:48 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I searched google for 'Ole2.Invoke_Obj' and found http://www.oraclefans.com/oraclefans/forum/dev2000/messages/2626.html as the first link. Try the different things this person has done with 'Ole2.Invoke_Obj'. One of them may help.

David
Previous Topic: Installing forms developer 6i on windows 2003
Next Topic: Problem with Menu + Directory problem (merged)
Goto Forum:
  


Current Time: Sun Dec 04 04:54:12 CST 2016

Total time taken to generate the page: 0.09561 seconds