Remove/Inactivate "X" in UserForm

  • Thread starter Thread starter Otto Moehrbach
  • Start date Start date
O

Otto Moehrbach

Excel XP & Win XP
An OP wants to remove (if possible) or inactivate the "X" button in the top
right corner of a UserForm. Is that possible, and if so, how?
Also, what code can I use to trap the action of clicking on that "X" and act
on that? Thanks for your time. Otto
 
Use the userform's QueryClose event:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If MsgBox("Allow close?", vbYesNo) = vbNo Then Cancel = True
End Sub


--
Jim
| Excel XP & Win XP
| An OP wants to remove (if possible) or inactivate the "X" button in the
top
| right corner of a UserForm. Is that possible, and if so, how?
| Also, what code can I use to trap the action of clicking on that "X" and
act
| on that? Thanks for your time. Otto
|
|
 
Back
Top