?The paragraph immediately above the code that you refer to explains where to place the code!N Prakash said:Hi
I got the code
Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
MsgBox "You can't close the form like that."
Cancel = True
End If
End Sub
Where to put this code, whether in the form or in the module.
Regards,
Prakash
... using a UserForm_QueryClose event procedure in the code module for the UserForm.