Excel process not ending when using External Objects

13 views
Skip to first unread message

John Shyne

unread,
Dec 3, 2010, 6:08:57 AM12/3/10
to openroa...@googlegroups.com

Hi All,

 

We have a problem with "EXCEL.EXE" processes hanging round in task manager when we use Excel External Objects from OpenROAD. The same thing does not happen when we use MS Word or when we do it from a WSF file (even without setting the objects to Nothing).

 

Has anyone else come across this or solved this or have any advice?

 

We have two external Objects:

“Microsoft Word 12.0 Object Library” called MSWord

“Microsoft Excel 12.0 Object Library” called MSExcel

 

/*Word*/

On Click =

Declare

                app = MSWord!application;

Begin

                app.Documents.Add(Template='Normal', NewTemplate=False, DocumentType=0);

                app.Selection.TypeText(Text='abc');

                app.Visible = True;

                app = Null;

End;

 

/*Excel*/

On Click=

Declare

    objXL = MSExcel!Application;

    objWbk = MSExcel!Workbook Default Null;

    objWst = MSExcel!Worksheet Default Null;

EndDeclare            

Begin

    objWbk = objXL.Workbooks.Add();

    objWst = objWbk.Worksheets.Add();

    objWst.Range('A1').Value = 'xyz';

    objXL.Visible = 1;

//    objXL.Quit(); //(The process is ended if use this line)

    objXL = Null;

    objWbk = Null;

    objWst = Null;

End;

 

 

/*Open Excel from WSF file*/

/*command line: cscript openexcel.wsf */

<job id="OpenExcel">

<script language="VBScript">

    Set objXl = CreateObject("Excel.Application")

    set objWbk = objXL.Workbooks.Add()

    set objWst = objWbk.Worksheets.Add()

    objWst.Range("A1").Value = "xyz"

    objXL.Visible = TRUE

'//    objXL.Quit();

'    set objXL = Nothing

'    set objWbk = Nothing

'    set objWst = Nothing

</script>

</job>

 

Many Thanks

John

 

 

_____________________________________________

 

     John Shyne

     Business Systems Team – ITS

     University of the West of England

     John....@uwe.ac.uk

     011732 81073

_____________________________________________

 

Reply all
Reply to author
Forward
0 new messages