Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: quit excel application

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi, All

    I was trying to quit excel application using Quit method, after working with and closing all its workbooks. The code is simple as following:

    excelApp.Quit
    Set excelApp = Nothing

    I got unhandled exception (access violation) says: "memory xxx refers memory xxx, can't read". So the application has to be closed manually.

    What is the problem?
    Thanks for all the input. / dan

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dan,

    I am not sure if this is what you want by just try using the following code to quit excel:
    Excel.Application.Quit

    I hope this helps.
    Kind regards,
    Al

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Al,
    Thanks for the reply.

    I tried what you said, and still get the same unhandled exception.

    I can do all sorts of thing, like adding workbook to the application, getting memory used by the application, except quit the application.

    Is there other way to close the application?

    Thanks /dan

  4. #4
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try just using Application.Quit

    It works for me. Where are you placing the code?

  5. #5
    Guest

    Default

    i tried the Excel.Application.Quit to quit excel and it does work so i suggest that the other person retries it.

  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am using RoseScript, which is Basic Script language similar to VB.

    I can't directly use Application.Quit.
    It has to be called as:
    myExcelApp.Application.Quit or
    myExcelApp.Quit

    dan

  7. #7
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    One more thing is that myExcelApp.Quit works fine with my other scripts, but only this one I got memory access violation.

    so I don't think there is the problem of syntax. It seems the program can't locate the application when trying to close it. But I can't figure out the reason, as I still can do things like adding workbook on this applicaition.

    Thanks /dan

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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