Search This Blog

Friday 14 September 2012

DISABLE CLOSE("X") BUTTON OF USERFORM


To disable the close(X) button of userform paste the below code on the QueryClose event of your userform.


Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
MsgBox "The X is disabled, please use a button on the form.", vbCritical
End If
End Sub

No comments:

Post a Comment