Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling the "X" (Close) on a UserForm
Is there a way in which to disable the X on a UserForm so
that User can not close out the form? I need to be able to do this for a spreadsheet that is used in both XL97 and XL02. Any help would be appreciated. Thanks. Kirk |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling the "X" (Close) on a UserForm
Thanks a lot. That worked PERFECT.
Kirk -----Original Message----- Kirk, Use the form's QueryClose event. This has 2 arguments, Cancel and CloseMode. CloseMode tells you where the close originates from. vbFormControlMenu 0 The user has chosen the Close command from the Control menu on the UserForm. vbFormCode 1 The Unload statement is invoked from code. vbAppWindows 2 The current Windows operating environment session is ending. vbAppTaskManager 3 The Windows Task Manager is closing the application. You can test this, and if it's from an unload statement, close else cancel Private Sub CommandButton1_Click() Unload Me End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Cancel = CloseMode < vbFormCode And CloseMode < vbAppWindows End Sub -- HTH Bob Phillips "Kirk" wrote in message ... Is there a way in which to disable the X on a UserForm so that User can not close out the form? I need to be able to do this for a spreadsheet that is used in both XL97 and XL02. Any help would be appreciated. Thanks. Kirk . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disabling the "&[Time]" or "&[T]" in Excel headers and footers | Excel Discussion (Misc queries) | |||
disabling default "text to columns" while *.csv file opening | Setting up and Configuration of Excel | |||
Disabling "wrap text" neuters alt-return line feeds within cell | Excel Discussion (Misc queries) | |||
Disabling "SAVE AS" option under "File" | Excel Discussion (Misc queries) | |||
How can I get "File Close" to prompt me to "Save Changes" ?? | Excel Programming |