+ Reply to Thread
Results 1 to 5 of 5

Close workbook without saving after msg box

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    47

    Close workbook without saving after msg box

    Hi,

    I have the following code which runs when the user tries to close my workbook

    HTML Code: 
    I would like the workbook to also close without saving as I don't want users to keep a copy and I don't want them to have another prompt box.

    Can anybody assist me to add the following code to the code I have above as I am having problems getting it to work.

    HTML Code: 
    Thank you very much in advance

    :-)

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Close workbook without saving after msg box

    maybe this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Close workbook without saving after msg box

    Hi John, thanks very much for your reply.

    This is similar to one of the options I had tried but it seems to cause excel to lock up and I have to start the task manager and quit it to shut it down.

    I presume it is getting trapped in a loop somewhere or something similar ?????

    What do you think?

    I want to be able to code it so that if a user clicks no on my message box nothing will happen but if they click yes the application closes without any prompting about saving the workbook.

    I hope that makes sense!

    :-)

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Close workbook without saving after msg box

    perhaps
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Registered User
    Join Date
    05-22-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Close workbook without saving after msg box

    Worked perfectly!!!!!!

    Thank you so much for your help

    :-) :-)

+ 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