Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I disable the close button on and Excel Form 1

Status
Not open for further replies.

Pedrowedro

Programmer
Nov 21, 2006
11
0
0
GB
Hi I have been trying to disable the close button in an excel form with no luck.

If it is not possible to disable it, is it possible to catch the code as it runs upon the event of the close button being pressed.

Thanks
 
Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
      Cancel = Not CloseMode
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top