+ Reply to Thread
Results 1 to 6 of 6

Macro Code for closing excel...

  1. #1
    Registered User
    Join Date
    02-23-2006
    Posts
    12

    Macro Code for closing excel...

    Hi there, i've made an Exit button. I want it to exit excel when clicked, but all i managed to do is close the workbook. Is there any way at all to close Excel? or is the furthest it goes is closing a workbook?

  2. #2
    Duncan
    Guest

    Re: Macro Code for closing excel...

    For Each w In Application.Workbooks
    w.Save
    Next w
    Application.Quit

    I think that does it, havent tested it yet though!,, might be better to
    do the save first and then time delay the quit as it will be real slow
    on a big workbook

    HTH

    Duncan


  3. #3
    Xcelion
    Guest

    RE: Macro Code for closing excel...

    Hi Bonbon

    use Application.Quit method to close excel

    Thanks
    Xcelion

    "Bonbon" wrote:

    >
    > Hi there, i've made an Exit button. I want it to exit excel when
    > clicked, but all i managed to do is close the workbook. Is there any
    > way at all to close Excel? or is the furthest it goes is closing a
    > workbook?
    >
    >
    > --
    > Bonbon
    > ------------------------------------------------------------------------
    > Bonbon's Profile: http://www.excelforum.com/member.php...o&userid=31866
    > View this thread: http://www.excelforum.com/showthread...hreadid=532192
    >
    >


  4. #4
    Registered User
    Join Date
    02-23-2006
    Posts
    12
    Quote Originally Posted by Duncan
    For Each w In Application.Workbooks
    w.Save
    Next w
    Application.Quit

    I think that does it, havent tested it yet though!,, might be better to
    do the save first and then time delay the quit as it will be real slow
    on a big workbook

    HTH

    Duncan
    Hi thanks for both the replies! But Duncan i dont understand the 'w' is it workbook or something?

  5. #5
    Duncan
    Guest

    Re: Macro Code for closing excel...

    Yep, exactly right, its just to save each workbook open or else it will
    pop up and say "do you want to save"

    Duncan


  6. #6
    Registered User
    Join Date
    02-23-2006
    Posts
    12
    Ah thank you, it worked great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1