Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: June Carroll   on Jan 12 In MS Office Category.

  
Question Answered By: Ivan Coleman   on Jan 12

This in the Thisworkbook code module:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If OkToClose Then Cancel = True
End Sub

OkToClose is a boolean global variable which you create and is set to
False most of the time (especially on opening the workbook!). The only
time it's set to True is in the code for your exit  buttons.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Stopping users from "x-ing" out of a workbook Or get search suggestion and latest updates.


Tagged: