+ 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
    15,772

    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)

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