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
Messages: 354
Registered: August 2006
Karma: 0
Senior Member

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:

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');

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'

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
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Karma: 0
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.

Previous Topic: Foreign Function
Next Topic: Triggers problem in forms6i
Goto Forum:

Current Time: Tue Aug 22 12:00:31 CDT 2017

Total time taken to generate the page: 0.15506 seconds