+ Reply to Thread
Results 1 to 5 of 5

Message Box on Workbook Close

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Message Box on Workbook Close

    I'm after a piece of code that gives the user a message box on closing the workbook.

    The message should say "Have changed the update time?"

    If Yes: close workbook
    If No: End Macro without closing workbook


    Thanks,
    Adam.

  2. #2
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Re: Message Box on Workbook Close

    Hi Adam,

    If Yes is chosen do you want to close the workbook and save changes?
    And if No is chosen you just want to go back to the workbook so the user can continue working?

    Is that correct
    Hope this helps

    Seamus

  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Message Box on Workbook Close

    If yes - then ask the user to save changes or not in the usual way
    If no - just want to go back to the workbook so the user can continue working

  4. #4
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Re: Message Box on Workbook Close

    Adam,

    Then I don't think it should be a Workbook Close event because no matter what button is chosen the workbook will close anyway. Still not sure though what type of event it should be. Will continue to think about it

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Message Box on Workbook Close

    What do you want to accomplish, or what do you want to prevent ?



+ 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