EXCEL: Disabling the X (close) button on a UserForm

Rabbitoh

Registered User.
Local time
Tomorrow, 08:48
Joined
Jul 17, 2006
Messages
34
Does anyone know how to disable the X on the top right corner of a Excel UserForm so that when a user clicks on it to close the form, they get a message saying "Please use the Exit button" (which is a macro button on the form itself)
 
Wrong forum. Please use the Excel forum when posting Excel questions. It is listed down in the Apps and Windows forums.

Use the OnClose event for the form. Cancel the event and post your messagebox. (Or, of course, just run the code that you have in your exit button macro ...)
 

Users who are viewing this thread

Back
Top Bottom