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