is preventing the appearence of the close symbol possible?

  • Thread starter Thread starter Marta
  • Start date Start date
M

Marta

Hi,
Can I prevent the appearence of the "X" symbol (for closing the window) on a
user form via a macro?. I'll be happy to hear any answers. Thanks in advance
whoever creates a solution.
 
Not as far as I know, but you CAN disable its functionality:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub

Bob Umlas
Excel MVP
 
Thanks to Tom and Bob,
I'll give both a try...

Bob Umlas said:
Not as far as I know, but you CAN disable its functionality:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub

Bob Umlas
Excel MVP

on
 
I usually divert the click to the Cancel button, since obviously the
user wants out.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then cmdCancel_Click
End Sub

- Jon
 
Back
Top