Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Application Quit (Excel 2000)

    I am trying to automatically quit excel without saving after the user clicks on the alert message that I display. The excel file is open by an attachment in an email. I have a excel module that currently does several things. But for some reason, using:
    DisplayAlerts = false
    Application.Quit
    But this does not work to quit Excel. I alway get an error -13.

    Any ideas to force quit Excel without the save alert.

    Thanks

  2. #2
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Trenton, Ontario
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Quit (Excel 2000)

    Check out <post#=288894>post 288894</post#>
    (Thanks Andrew C. it worked great for me.)

  3. #3
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Quit (Excel 2000)

    I have looked at that and I have the same code, but I still get an Error Type -13, Type Mismatch. It seems straightforward enough to quit excel. Any other ideas.

    Thanks

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Quit (Excel 2000)

    When you get the Error Type -13, is there a Debug button in the error box? If so, what line of code is highlited if you push that button?
    Legare Coleman

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Application Quit (Excel 2000)

    In addition to Legare's question, do you specify Option Explicit at the beginning of your code? Is the code run from the spreadsheet? How do you handle the situation where a user already has Excel open; isn't it a bit rude to quit the application without an Alert if they have other unsaved work?
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Quit (Excel 2000)

    Yes I have the Option Explict and the error occurs on the line
    application.quit

    The form does quit after I click end on the application

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Quit (Excel 2000)

    Could you post a stripped down version of your workbook here that still shows the problem? (ZIP it please)
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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