+ Reply to Thread
Results 1 to 2 of 2

Cancel Close outside BeforeClose Event

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Cancel Close outside BeforeClose Event

    Whenever a user saves, I run through a special set of coding to save the file for them. If certain fields are blank, then I warn them and the file isn't saved. This works great, except when they close the workbook and save the file because if it fails, then the workbook still closes. The problem being that the BeforeClose event fires before it asks if they wish to save, so I can't use the BeforeClose event to cancel the close if the save fails.

    So, is there a way to cancel a close outside of the BeforeClose event?
    Last edited by yawnzzzz; 05-01-2011 at 11:44 AM.

  2. #2
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: Cancel Close outside BeforeClose Event

    The solution I just decided to go with was to build in the save dialogue box in the beforeclose event. If Yes is selected, then I run my code and cancel the close if it fails. If No is selected, then I set the workbook's saved property to true, so it doesn't ask the user again if they wish to save. And if Cancel is selected, then I cancel the close.

    Please Login or Register  to view this content.

+ 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