View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Disabling the red X on the top right of a form.

Jon,
Yes, I would be annoyed if the form did not act the way it (Windows) is
designed to work.
If it does not function, then it should not be there.

NickHK

"Jon Peltier" wrote in message
...
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