Results 1 to 3 of 3

Thread: Excel won't completely close!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Hi,

    I'm having trouble completly closing Excel
    I'm creating the Excel object like this:

    Set appxl = CreateObject("Excel.Application")
    Set xl = appxl.Application


    'Then I'm killing it like this:

    Set appxl = GetObject(, "EXCEL.Application")
    With appxl
    .ActiveWorkbook.Close savechanges:=False
    .Quit
    End With
    Set appxl = Nothing
    Set xl = Nothing

    It disapears from the taskbar as if it's gone but low and behold it's still sitting as open in the task manager.
    What am I doing wrong? It still closes with my application but I want it gone when I tell it to go!
    Please help.

    Thank You in advance.

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    You should try something like this:

    Set appxl = CreateObject("Excel.Application")
    Set xl = appxl.Application

    'Get rid of this line because you are creating another 'instance I believe
    'Set appxl = GetObject(, "EXCEL.Application")


    Your Processing Area

    With appxl
    .ActiveWorkbook.Close savechanges:=False
    .Quit
    End With

    Set appxl = Nothing
    Set xl = Nothing



    Try this and let me know because I experienced something like this many years ago.

    [Edited by Nitro on 04-18-2000 at 08:41 PM]
    Chemically Formulated As:
    Dr. Nitro

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Thanks Nitro,
    That was it - I was creating another instance as well as closing excel before it could close anything else. It's all cleared up now thanks to you.
    Joey o

Posting Permissions

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



Click Here to Expand Forum to Full Width