Since the user is generally trying to cancel the userform, I execute the
cancel button code from this event. It keeps the user's annoyance level
down.
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
CancelButton_Click
End If
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
PraxisPete wrote:
I am no expert but try this in the code module for the UserForm
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
End Sub
"jlroper" wrote:
Does anyone know how to disable the red X on the top right of a form?
--
jlroper
------------------------------------------------------------------------
jlroper's Profile: http://www.excelforum.com/member.php...o&userid=26709
View this thread: http://www.excelforum.com/showthread...hreadid=401423