quit app - Tushar Mehta HELP

  • Thread starter Vacation's Over
  • Start date
V

Vacation's Over

I have "the phantom app Excel.EXE" issue, addressed on Tushar's site.

It happened in code where I create a new instance of excel and do lots of
stuff. I have tried qualifying everything. Finally boiled down to the
following lies of code that will produce the problem.. The line that adds a
workbook seems to be the problem, although I have tried everything I could
think of, even pausing and manually opening a blank workbook....still get the
phantom on closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
J

Jake Marx

Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]
 
V

Vacation's Over

Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

Jake Marx said:
Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's site.

It happened in code where I create a new instance of excel and do
lots of stuff. I have tried qualifying everything. Finally boiled
down to the following lies of code that will produce the problem..
The line that adds a workbook seems to be the problem, although I
have tried everything I could think of, even pausing and manually
opening a blank workbook....still get the phantom on closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
J

Jake Marx

Hi,

I'm not sure how you expect there to be 0 instances of Excel running (unless
you're automating Excel from VB or something), as the current instance of
Excel will not be shut down by the code you posted. If I run the code I
posted, I'm left with only 1 instance of Excel - the instance I put the code
in.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

Jake Marx said:
Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's
site.

It happened in code where I create a new instance of excel and do
lots of stuff. I have tried qualifying everything. Finally boiled
down to the following lies of code that will produce the problem..
The line that adds a workbook seems to be the problem, although I
have tried everything I could think of, even pausing and manually
opening a blank workbook....still get the phantom on closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
V

Vacation's Over

Jake-
Thanks again, maybe i have a syatem setting problem.

Here is what I get on my PC, XL2003, XP Pro

Start Task manager without Excel
ZERO EXCEL.EXE

open Excel
One EXCEL.EXE

Run code
TWO EXCEL.EXE (even after code is done)

Exit Excel
STILL: ONE EXCEL.EXE

[Repeat above process and I get TWO EXCEL.EXE without VISIBLE EXCEL WINDOWS]

Jake Marx said:
Hi,

I'm not sure how you expect there to be 0 instances of Excel running (unless
you're automating Excel from VB or something), as the current instance of
Excel will not be shut down by the code you posted. If I run the code I
posted, I'm left with only 1 instance of Excel - the instance I put the code
in.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

Jake Marx said:
Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's
site.

It happened in code where I create a new instance of excel and do
lots of stuff. I have tried qualifying everything. Finally boiled
down to the following lies of code that will produce the problem..
The line that adds a workbook seems to be the problem, although I
have tried everything I could think of, even pausing and manually
opening a blank workbook....still get the phantom on closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
J

Jake Marx

Does this occur when running the following code exactly as shown?

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

It works on my machine (similar setup to yours) - I only have one instance
of Excel left, then zero after I quit the visible instance.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake-
Thanks again, maybe i have a syatem setting problem.

Here is what I get on my PC, XL2003, XP Pro

Start Task manager without Excel
ZERO EXCEL.EXE

open Excel
One EXCEL.EXE

Run code
TWO EXCEL.EXE (even after code is done)

Exit Excel
STILL: ONE EXCEL.EXE

[Repeat above process and I get TWO EXCEL.EXE without VISIBLE EXCEL
WINDOWS]

Jake Marx said:
Hi,

I'm not sure how you expect there to be 0 instances of Excel running
(unless you're automating Excel from VB or something), as the
current instance of Excel will not be shut down by the code you
posted. If I run the code I posted, I'm left with only 1 instance
of Excel - the instance I put the code in.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

:

Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's
site.

It happened in code where I create a new instance of excel and do
lots of stuff. I have tried qualifying everything. Finally
boiled down to the following lies of code that will produce the
problem.. The line that adds a workbook seems to be the problem,
although I have tried everything I could think of, even pausing
and manually opening a blank workbook....still get the phantom on
closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
V

Vacation's Over

Thanks for staying with this-

OK I turned off all addins
rebooted
launched excel
cut & pasted your code in a new module of a "blank" workbook
ran the code
Got exactly the same results that I got last time
NOT what you get on your machine

I'm going to go through Tushar's method of disconnecting references and see
what else I can think of....

Jake Marx said:
Does this occur when running the following code exactly as shown?

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

It works on my machine (similar setup to yours) - I only have one instance
of Excel left, then zero after I quit the visible instance.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake-
Thanks again, maybe i have a syatem setting problem.

Here is what I get on my PC, XL2003, XP Pro

Start Task manager without Excel
ZERO EXCEL.EXE

open Excel
One EXCEL.EXE

Run code
TWO EXCEL.EXE (even after code is done)

Exit Excel
STILL: ONE EXCEL.EXE

[Repeat above process and I get TWO EXCEL.EXE without VISIBLE EXCEL
WINDOWS]

Jake Marx said:
Hi,

I'm not sure how you expect there to be 0 instances of Excel running
(unless you're automating Excel from VB or something), as the
current instance of Excel will not be shut down by the code you
posted. If I run the code I posted, I'm left with only 1 instance
of Excel - the instance I put the code in.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

:

Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's
site.

It happened in code where I create a new instance of excel and do
lots of stuff. I have tried qualifying everything. Finally
boiled down to the following lies of code that will produce the
problem.. The line that adds a workbook seems to be the problem,
although I have tried everything I could think of, even pausing
and manually opening a blank workbook....still get the phantom on
closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
V

Vacation's Over

Jake -

Tanks for your help.

I finally found it. With your help i knew it was my PC and not my code.

Truns out I had loaded Act! 6.0 and it inserted its own addin that some how
was causing the problem with a second instance. Aslso was holding a phantom
of Word.

I am working with Sage to resolve and will post back.

Never would have figured it out without your help this weekend. So used to
my code being the problem....

Jake Marx said:
Does this occur when running the following code exactly as shown?

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

It works on my machine (similar setup to yours) - I only have one instance
of Excel left, then zero after I quit the visible instance.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake-
Thanks again, maybe i have a syatem setting problem.

Here is what I get on my PC, XL2003, XP Pro

Start Task manager without Excel
ZERO EXCEL.EXE

open Excel
One EXCEL.EXE

Run code
TWO EXCEL.EXE (even after code is done)

Exit Excel
STILL: ONE EXCEL.EXE

[Repeat above process and I get TWO EXCEL.EXE without VISIBLE EXCEL
WINDOWS]

Jake Marx said:
Hi,

I'm not sure how you expect there to be 0 instances of Excel running
(unless you're automating Excel from VB or something), as the
current instance of Excel will not be shut down by the code you
posted. If I run the code I posted, I'm left with only 1 instance
of Excel - the instance I put the code in.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

:

Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's
site.

It happened in code where I create a new instance of excel and do
lots of stuff. I have tried qualifying everything. Finally
boiled down to the following lies of code that will produce the
problem.. The line that adds a workbook seems to be the problem,
although I have tried everything I could think of, even pausing
and manually opening a blank workbook....still get the phantom on
closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 
J

Jake Marx

Glad to hear it. It's nice to know it's not always the code. <g>

-Jake

Vacation's Over said:
Jake -

Tanks for your help.

I finally found it. With your help i knew it was my PC and not my
code.

Truns out I had loaded Act! 6.0 and it inserted its own addin that
some how was causing the problem with a second instance. Aslso was
holding a phantom of Word.

I am working with Sage to resolve and will post back.

Never would have figured it out without your help this weekend. So
used to my code being the problem....

Jake Marx said:
Does this occur when running the following code exactly as shown?

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

It works on my machine (similar setup to yours) - I only have one
instance of Excel left, then zero after I quit the visible instance.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over said:
Jake-
Thanks again, maybe i have a syatem setting problem.

Here is what I get on my PC, XL2003, XP Pro

Start Task manager without Excel
ZERO EXCEL.EXE

open Excel
One EXCEL.EXE

Run code
TWO EXCEL.EXE (even after code is done)

Exit Excel
STILL: ONE EXCEL.EXE

[Repeat above process and I get TWO EXCEL.EXE without VISIBLE EXCEL
WINDOWS]

:

Hi,

I'm not sure how you expect there to be 0 instances of Excel
running (unless you're automating Excel from VB or something), as
the current instance of Excel will not be shut down by the code you
posted. If I run the code I posted, I'm left with only 1 instance
of Excel - the instance I put the code in.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Vacation's Over wrote:
Jake -

THANKS, but This does not address the issue.

to see teh problem:

CTR/ALT/DEL to pull up task manager > Processes

try to get to zero EXCEL.EXE instances after running the code

(without clicking end process, or a system reboot)

:

Hi,

Here's how I would do it:

Sub NEWAPPTEST()
Dim xlWB As Object
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
Set xlWB = XLNEW.Workbooks.Add
'/ now you can use xlWB for your operations on the workbook
xlWB.Close False
Set xlWB = Nothing
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address
unmonitored]

Vacation's Over wrote:
I have "the phantom app Excel.EXE" issue, addressed on Tushar's
site.

It happened in code where I create a new instance of excel and
do lots of stuff. I have tried qualifying everything. Finally
boiled down to the following lies of code that will produce the
problem.. The line that adds a workbook seems to be the problem,
although I have tried everything I could think of, even pausing
and manually opening a blank workbook....still get the phantom
on closing.

Thanks for the help...

Option Explicit

Public XLNEW As Object
Public XLUser As Object

Sub NEWAPPTEST()
Set XLUser = GetObject(, "excel.application")
Set XLNEW = CreateObject("excel.application")
XLNEW.Workbooks.Add
'additional code here typically
XLNEW.Workbooks().Close
XLNEW.Quit
Set XLNEW = Nothing
set xluser = nothing
End Sub
 

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