Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
The userform X button
Hi
Is it possible to disable the close button (the "X") on a userform? And how? --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
The userform X button
In the userform's UserForm_QueryClose event set Cancel to 1:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = 0 Then Cancel = 1 ''0 = "x" clicked. 1 = Unload Me End Sub Private Sub CommandButton1_Click() Unload Me End Sub -- Jim Rech Excel MVP "Esben " wrote in message ... | Hi | | Is it possible to disable the close button (the "X") on a userform? And | how? | | | --- | Message posted from http://www.ExcelForum.com/ | |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
The userform X button
have a look in the object browser for vbQueryClos
theses are the values for closemode in Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer Const vbFormControlMenu = 0 ' this is if u close the form by clicking the "X" butto Const vbFormCode = 1 ' u want to close it from somewhere in the code u have writte Const vbAppWindows = 2 ' if windows is closing the applicatio Const vbAppTaskManager = 3 ' u closed the application from teh task manage Const vbFormMDIForm = |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW to close a userform using a button | Excel Discussion (Misc queries) | |||
Userform + close button | Excel Discussion (Misc queries) | |||
Use the X button on a userform | Excel Discussion (Misc queries) | |||
Userform Close button | Excel Programming | |||
UserForm Button Help | Excel Programming |