Results 1 to 7 of 7

Thread: URGENT! Killing Excel URGENT!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Angry

    My app launches an Excel which I can't get rid of!

    I'm using

    Code:
        oXL.DisplayAlerts = False
        oXL.ActiveWorkbook.Save
        oXL.Application.Quit
        Set oXL = Nothing
    where oXl is the Excel.Application object. I've tried it
    both invisible and visible and the EXCEL.EXE will not
    disappear from the Task manager (no errors generated).

    I'm assuming this is because I still have an 'un-Nothing-ed'
    object reference somewhere...is it?

    And what can I do about it?

    Please help!!!!!



    Dan


  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    Hi,

    You could try this :

    1) Find a handle to the app (by it's caption and the FindWindow API)

    2) Send this window a WM_CLOSE ( &H10 ) with the sendmessage API.

    Worked for me so I hope it will work for you too...

    Bye

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Unhappy

    That night work, but...

    a) the window actually closes (in visible mode), its the excel.exe I can't get rid of.

    b) I'd prefer not to be so heavy handed...I don't want to be leaking resources all over the shop.


    Thanks for the suggestion though,



    Dan

  4. #4
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    add an

    oxl.quit

    in there and it should die gracefully.

  5. #5
    Lively Member
    Join Date
    Jan 2000
    Posts
    76
    see getobject
    example in VB help
    and also at runtime add watch on ur
    xlsobject.application
    u will get all the properties

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Unhappy

    Thanks for your suggestions peeps, but none of them seem to work

    I can't kill it, I need to release everything properly so no files are marked as locked and I can use them again when I next run my app.

    I'll keep trying I guess...



    Dan

  7. #7
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    It should be:

    oXL.DisplayAlerts = False
    oXL.ActiveWorkbook.Save
    oXL.Workbooks.Close
    oXL.Application.Quit
    oXL.Quit
    Set oXL = Nothing

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