Results 1 to 8 of 8

Restricting close workbook until Saved in excel macro

Threaded View

Scofield24 Restricting close workbook... 02-06-2014, 08:15 AM
john55 Re: Restricting close... 02-07-2014, 09:05 AM
Scofield24 Re: Restricting close... 02-07-2014, 01:29 PM
john55 Re: Restricting close... 02-07-2014, 02:32 PM
Scofield24 Re: Restricting close... 02-08-2014, 12:27 PM
john55 Re: Restricting close... 02-08-2014, 12:46 PM
Scofield24 Re: Restricting close... 02-09-2014, 05:35 AM
Scofield24 Re: Restricting close... 02-14-2014, 07:39 AM
  1. #1
    Registered User
    Join Date
    07-13-2013
    Location
    Austin
    MS-Off Ver
    Excel 2007
    Posts
    30

    Restricting close workbook until Saved in excel macro

    Hi All,

    I have created a workbook with multiple mandatory fields within it. What i wish is that all these fields must be filled before the workbook can be closed. For this i've tried 2 cases:-

    Case 1: Using BeforeClose event in Macro

    Problem with this is that user can leave the mandatory field blank and save it. Although he wont be able to close, but if he copies this saved workbook (by going to its location) to some other location(say) , he can use that copy as the original one.

    Now you would think, why wouold he do that. Answer is i dont want to leave any loophole in this.


    Case 2: Using BeforeSave event

    Problem with this is that when a i try to close the sheet with some mandatory field blank, it will prompt me "Do you need to save the changes,etc" . If i click Yes, it will prompt (created by me) to fill the mandatory field , and then close. And the field would be blank, next time we open it.


    So, How can i restrict the close until all the mandatory fields are filled and saved??


    Appreciate your help.

    Thanks
    Last edited by Scofield24; 02-06-2014 at 08:18 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Look for and Open saved workbook retrieve information into new WB then close them
    By Aeneren in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-27-2012, 10:42 PM
  2. Excel crashes when macro gets workbook to close
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2011, 09:50 AM
  3. Macro to close down word and re-open a previously saved document
    By snoopy1461 in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2011, 09:59 AM
  4. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM
  5. running macro on close of workbook/excel
    By neowok in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2005, 10:36 AM

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