Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent a workbook being closed with the X
I am using Excel 97. Is there anyway that you can prevent users on a
workbook from closing the workbook with the 'X' in the top right hand corner? Thanks -- Mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent a workbook being closed with the X
In the "thisworkbook" module add a BeforeClose event something like this
Private Sub Workbook_BeforeClose(Cancel As Boolean) Cancel = True MsgBox "This is not how you close this workbook..." End Sub Then in the close button or however you intend to close the workbook add in an Application.enableevents = false to keep this code from firing when you really want to clost the book. (Just as a note I usually try to avoid doing things like this because the users find it fraustrating when they can't close a program through normal windows functions. They start doing things like hitting the power button or going into the task manager and ending things) -- HTH... Jim Thomlinson "Mark" wrote: I am using Excel 97. Is there anyway that you can prevent users on a workbook from closing the workbook with the 'X' in the top right hand corner? Thanks -- Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Value from a closed workbook | Excel Discussion (Misc queries) | |||
copy from closed workbook again! ;( | Excel Programming | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
Getting value from closed workbook | Excel Programming | |||
Accessing Closed Workbook | Excel Programming |