Stop X Button use on Forms

This puts up an error if the user trys to use the X button on a VBA Form.

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

Code Snippits