Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quiting Excel from Macro (XP)

    Good Evening

    I would like to be able to exit Excel from a macro. I've not been able to ferret this out from the books I've reviewed. Any thoughts?

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Quiting Excel from Macro (XP)

    Hi Mark,

    From within Excel, the simple statement:
    Application.Quit
    in a macro will cause Excel to close, generating the usual messages about whether you want to save your work. There's also various ways of coding such a routine to force Excel to save, or close without saving, so as to avoid those prompts too. All depends on what you want to do, and how you want to treat whatever workbooks might be open at the time. You can also use macros in other applications (eg Word) to open and close Excel.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    New Lounger
    Join Date
    Jan 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Quiting Excel from Macro (XP)

    Thanks, the Application.Quit works like a champ. --Mark

Posting Permissions

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