+ Reply to Thread
Results 1 to 9 of 9

quit app - Tushar Mehta HELP

  1. #1
    Vacation's Over
    Guest

    quit app - Tushar Mehta HELP

    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

  2. #2
    Jake Marx
    Guest

    Re: quit app - Tushar Mehta HELP

    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




  3. #3
    Vacation's Over
    Guest

    Re: quit app - Tushar Mehta HELP

    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" wrote:

    > 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

    >
    >
    >


  4. #4
    Jake Marx
    Guest

    Re: quit app - Tushar Mehta HELP

    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)
    >
    > "Jake Marx" wrote:
    >
    >> 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




  5. #5
    Vacation's Over
    Guest

    Re: quit app - Tushar Mehta HELP


    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" wrote:

    > 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)
    > >
    > > "Jake Marx" wrote:
    > >
    > >> 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

    >
    >
    >


  6. #6
    Jake Marx
    Guest

    Re: quit app - Tushar Mehta HELP

    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 wrote:
    > 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" wrote:
    >
    >> 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)
    >>>
    >>> "Jake Marx" wrote:
    >>>
    >>>> 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




  7. #7
    Vacation's Over
    Guest

    Re: quit app - Tushar Mehta HELP

    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" wrote:

    > 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 wrote:
    > > 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" wrote:
    > >
    > >> 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)
    > >>>
    > >>> "Jake Marx" wrote:
    > >>>
    > >>>> 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

    >
    >
    >


  8. #8
    Vacation's Over
    Guest

    Re: quit app - Tushar Mehta HELP

    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" wrote:

    > 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 wrote:
    > > 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" wrote:
    > >
    > >> 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)
    > >>>
    > >>> "Jake Marx" wrote:
    > >>>
    > >>>> 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

    >
    >
    >


  9. #9
    Jake Marx
    Guest

    Re: quit app - Tushar Mehta HELP

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

    -Jake

    Vacation's Over wrote:
    > 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" wrote:
    >
    >> 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 wrote:
    >>> 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" wrote:
    >>>
    >>>> 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)
    >>>>>
    >>>>> "Jake Marx" wrote:
    >>>>>
    >>>>>> 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




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1