+ Reply to Thread
Results 1 to 2 of 2

Close a Workbook, Prompt to Save, then close workbook and Excel

  1. #1
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    59

    Close a Workbook, Prompt to Save, then close workbook and Excel

    I’ve noticed many people trying to find code that on closing a workbook will prompt to save (if changes were made) and then close the workbook and close Excel. The following code should do the trick.

    Place this code in a module and link to a command button or shape
    Please Login or Register  to view this content.
    *******************************************
    Place the code below in ThisWorkbook
    Please Login or Register  to view this content.
    Last edited by alansidman; 04-01-2018 at 09:39 PM. Reason: Correct Spelling

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    17,741

    Re: Close a Workbook, Prompt to Save, then close workbook and Excel

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

+ 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. [SOLVED] VBA Prompt to close PDF so file can be overwrtitten or close automatically
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2014, 12:31 PM
  2. Replies: 1
    Last Post: 10-25-2013, 06:10 PM
  3. [SOLVED] save without prompt and close the workbook at the same time
    By bta in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2012, 06:43 AM
  4. Auto close, save to new file without prompt
    By Bafa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2007, 10:31 AM
  5. Intercepting the file save prompt before close?
    By Neil Bhandar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2006, 11:20 PM
  6. CLOSE ALL macro for XL2K (but with prompt to save for each file)?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 10:05 AM
  7. [SOLVED] Save Changes Prompt at close
    By Johnewally in forum Excel General
    Replies: 2
    Last Post: 03-17-2005, 06:06 PM

Tags for this Thread

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