Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Seymour, Connecticut, USA
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel Macro Help

    I currently run a macro in excel 97 that closes the active worksheet after it is saved. Can code be added to this macro to also close excel?

    Thanks in advance. <img src=/S/question.gif border=0 alt=question width=15 height=15>

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

    Re: Excel Macro Help

    You sure can:

    <pre> Application.Quit
    </pre>

    Legare Coleman

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Seymour, Connecticut, USA
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Macro Help

    I tried Application.Quit and it didn't do what i was hoping it would. Maybe i'm asking the wrong question. The last two lines of code in my macro are ActiveWorkbook.Close and
    ActiveWorkbook.Close. One closes my private macro file the other closes the active workbook. I then have another screen titled Microsoft Excel. The body of the screen is a
    real ugly brown-olive drab color. The standard tool bar is active but the formatting toolbar is "grayed out". I close it using the "X" in the upper right hand corner. That's the screen I would like to close.

    If that's the screen application.close is supposed to close
    do you have any idea what i may be doing wrong to prevent it from working? If the description of my problem was unclear in my first post and what I'm now describing would not close with application.close is there a way to automatically close this screen?

    Again, thanks in advance

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

    Re: Excel Macro Help

    If one of those ActiveWorkbook.Close statements closes your macro workbook, then the macro will stop running and never get to the Application.Quit to close Excel. Try replacing the second of those ActiveWorkbook.Close statements with an Application.Quit.
    Legare Coleman

  5. #5
    Lounger
    Join Date
    Jan 2001
    Location
    Seymour, Connecticut, USA
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Macro Help

    Legare, Thanks. The removal of the activeworkbook.close did the trick. it makes good sense once someone tells it to
    you. I guess that's why i don't make the big bucks.

Posting Permissions

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