EXCEL.exe stays open after Quit method in an HTA

M

myriams9

Im trying to close the Excel.exe that is open in my
Processes .Imm usng JSCRIPt and VBScript,

var ExcelApp =new ActiveXObject ("Excel.Application") ;

....
ExcelApp.Quit();
//ExcelApp = null;
NAR (ExcelApp);

<script lanugae = "VBscript">
Sub NAR( ByVal O)
Set o = Nothing
End Sub

Still my Processes show an instance open

How can I do this? Any help?
Need to save 35 times and can't have 35 instances of
Excel .exe running
 
J

Jan Karel Pieterse

Hi Myriams9,
Still my Processes show an instance open

Are all other references using Excel Objects neatly closed and set to
nothing before you execute Excel's Application.Quit and set it's object
to nothing ?

Is there any workbook still open in Excel, waiting for a save changes
prompt to be handled?

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 
K

Kevin Beckham

In the scripting environment that I've used, try

Var xlObj

Set xlObj = GetObject("workbookname.xls")
or
Set xlObj = GetObject("", "Excel.Workbook")
then

xlObj.Quit
Set xlObj = Nothing

Kevin Beckham
 
G

Guest

I'll move my code to VBScript
as it seems to behave better. Have no idea how to set the
value to nothing on JSCript
Perhaps undefined?
 
G

Guest

Im using JAvascript and despite teh call to set the
object to Nothing it does not work.
I'll port the script to VBScript direclty adthen Ill see
if I neatly close all objects
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top