+ Reply to Thread
Results 1 to 2 of 2

Macro to close and save file with message box - error button to be clicked twice

  1. #1
    Registered User
    Join Date
    02-02-2013
    Location
    NL
    MS-Off Ver
    Excel 2010
    Posts
    63

    Macro to close and save file with message box - error button to be clicked twice

    All, I have a problem. I want to have the user to select whether they want to save the file.
    This is done via a message box with YES (save and exit workbook), NO (exit workbook), CANCEL (do nothing).

    However, for some reason the message box buttons need to be clicked twice to close the workbook.

    The code I am using is as follows:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    What am I doing wrong?

    Regards,
    Martin

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to close and save file with message box - error button to be clicked twice

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Not Responding after running Save and Close Macro Button
    By mangesh.mehendale in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2016, 08:25 AM
  2. Macro to turn off save box when user click close button
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-22-2016, 07:43 AM
  3. Run-time error 70 when button is clicked to run macro that opens email
    By blacklotus0014 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-02-2013, 09:54 AM
  4. [SOLVED] Click button to save as file name --> open message if range is 1
    By debbiesh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2012, 03:05 PM
  5. Determine if the close button in excel 2007 is clicked
    By Hudas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2012, 10:43 AM
  6. How to disable save message when I click the cross to close the file
    By hon123456 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2006, 02:20 AM
  7. Replies: 3
    Last Post: 08-12-2005, 03:05 PM

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