Home » Developer & Programmer » Forms » Ugent!! Help!!Help! Where to rename the Excel WorkSheet when I add new WorkSheet with OLE2 in oracle
Ugent!! Help!!Help! Where to rename the Excel WorkSheet when I add new WorkSheet with OLE2 in oracle [message #77747] Sun, 11 November 2001 23:06 Go to next message
Mike
Messages: 417
Registered: September 1998
Senior Member
My Os is win2000 professional.
I use the oracle developer/2000 Form.
Question1:
From Form online help,I only can find a little parameters form ole2,where to find it more??
For example: OLE2.INVOKE_OBJ(worksheets, 'Add');
The online help didn't describe much property,such as Add,..?? Where to find more information ??
Question2:
I want to rename the Excel WorkSheet when I add new WorkSheet,how to do it with Ole2 in Form??

Question3:
When I close and release the Excel Application with Ole2,the Excel.exe still exist in the Task Memory.
How to really release it??
Form example I use is below:
OLE2.INVOKE(workbook,'Close');
OLE2.INVOKE(application, 'Quit');
OLE2.RELEASE_OBJ(workbooks);
OLE2.RELEASE_OBJ(application);

----------------------------------------------------------------------
Re: Ugent!! Help!!Help! Where to rename the Excel WorkSheet when I add new WorkSheet with OLE2 in or [message #77756 is a reply to message #77747] Tue, 13 November 2001 05:11 Go to previous messageGo to next message
Srinivas Konda
Messages: 29
Registered: October 2001
Junior Member
Hope the following will help you.

args := OLE2.CREATE_ARGLIST;

-- to save as the file to some other file.
OLE2.ADD_ARG(args, :excel.file_name);
OLE2.INVOKE(worksheet, 'SaveAs', args);

-- Release the OLE objects
OLE2.DESTROY_ARGLIST(args);
OLE2.RELEASE_OBJ(cell);
OLE2.RELEASE_OBJ(worksheet);
OLE2.RELEASE_OBJ(worksheets);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.RELEASE_OBJ(application);

Let me know if you need more info.

----------------------------------------------------------------------
Re: Ugent!! Help!!Help! Where to rename the Excel WorkSheet when I add new WorkSheet with OLE2 in or [message #77792 is a reply to message #77747] Wed, 21 November 2001 02:46 Go to previous message
Srinivas Konda
Messages: 29
Registered: October 2001
Junior Member
Use this code to rename a worksheet.

The follwing code renames worksheet ABC -> XYZ.

PROCEDURE RENAME_SHEET IS
BEGIN
--*** Open and rename the sheet
args:=ole2.create_arglist;
ole2.add_arg(args,'ABC');
worksheet:=ole2.get_obj_property(workbook,'Worksheets',args);
ole2.destroy_arglist(args);
ole2.set_property(Worksheet,'Name','XYZ');
END;

----------------------------------------------------------------------
Previous Topic: Re: URGENT QUeries
Next Topic: Re: Prompt Background Color in Forms 6
Goto Forum:
  


Current Time: Thu Apr 18 18:02:22 CDT 2024