Hi! Thank you for your quick response. I don't know why but this is not working for me. I also tried :

PrivateSub UserForm_QueryClose(Cancel AsInteger, CloseMode AsInteger)
'Prevent user from closing with the Close box in the title bar.
If CloseMode <> 1Then Cancel = 1
MsgBox "Sorry, this button is disabled.", vbOKOnly, "'X' not in use!"

EndSub

Quote Originally Posted by paulked View Post
This disables the X :

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = vbFormControlMenu Then
        Cancel = True
        MsgBox "Sorry, this button is disabled.", vbOKOnly, "'X' not in use!"
    End If
End Sub