+ Reply to Thread
Results 1 to 3 of 3

CLOSE ALL macro for XL2K (but with prompt to save for each file)?

  1. #1
    StargateFan
    Guest

    CLOSE ALL macro for XL2K (but with prompt to save for each file)?

    Word's CLOSE ALL isn't as nice as WP's - where a small box appears and
    you just tick to save or not in a box under each column whether or not
    to save for each open file - but it still is good in that it prompts
    you before closing each file. I searched yesterday for VB code for
    Excel and it seems that there are only 2 kinds: either you save all
    files or save none, arbitrarily, while closing all. This isn't good.
    Is there code anywhere that prompts for each open file whether or not
    to save each one before closing all open workbooks? Tx.


  2. #2
    Tom Ogilvy
    Guest

    Re: CLOSE ALL macro for XL2K (but with prompt to save for each file)?

    Dim ans as Boolean
    for each bk in Workbooks
    if bk.Name <> thisworkbook.Name then
    ' code to prompt - put results in boolean variable ans
    bk.Close SaveChanges:=ans
    end if
    Next
    Application.Quit

    --
    Regards,
    Tom Ogilvy

    "StargateFan" <IDon'tAcceptSpam@IDon'tAcceptSpam.com> wrote in message
    news:[email protected]...
    > Word's CLOSE ALL isn't as nice as WP's - where a small box appears and
    > you just tick to save or not in a box under each column whether or not
    > to save for each open file - but it still is good in that it prompts
    > you before closing each file. I searched yesterday for VB code for
    > Excel and it seems that there are only 2 kinds: either you save all
    > files or save none, arbitrarily, while closing all. This isn't good.
    > Is there code anywhere that prompts for each open file whether or not
    > to save each one before closing all open workbooks? Tx.
    >




  3. #3
    Dave Peterson
    Guest

    Re: CLOSE ALL macro for XL2K (but with prompt to save for each file)?

    Do you want to quit excel?

    If yes, I used this line:

    application.quit

    And got prompted to save any workbooks that were changed.



    StargateFan wrote:
    >
    > Word's CLOSE ALL isn't as nice as WP's - where a small box appears and
    > you just tick to save or not in a box under each column whether or not
    > to save for each open file - but it still is good in that it prompts
    > you before closing each file. I searched yesterday for VB code for
    > Excel and it seems that there are only 2 kinds: either you save all
    > files or save none, arbitrarily, while closing all. This isn't good.
    > Is there code anywhere that prompts for each open file whether or not
    > to save each one before closing all open workbooks? Tx.


    --

    Dave Peterson

+ 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