Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need to intercept when the user clicks the 'X' on the title bar to close the userform instead of my 'Close' button and run code. In researching on the newsgroup I found two sets of code. I am wondering what the difference is between the two and which would be better to use. Choice 1: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = 0 Then MsgBox "This option will not close the form" Cancel = 1 End If End Sub Choice 2: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then ' make user do what you want" Cancel = True End If End Sub -- Thanks for your help. Karen53 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Close Userform | Excel Programming | |||
Close Userform | Excel Programming | |||
Userform close button | Excel Discussion (Misc queries) | |||
close UserForm | Excel Programming | |||
Close a userform | Excel Programming |