Disable the Close button to ensure your dialog box gets the attention it needs
by Kara Soos
Application:
Microsoft Excel 2000/2002/2003/2004/2007
Operating Systems:
Microsoft Windows, Macintosh
When you create a dialog box with VBA, it’s frustrating to think that anyone can dismiss it in one click. This means that the hard work you spent on creating a dialog box that serves an important purpose (often to the user’s advantage!) goes to waste. For instance, in the accompanying article “Tailor your workbook’s data while ensuring a clean slate for coworkers,” a colleague can sidestep the dialog box we create by clicking the red Close button.
You can stop this by disabling the all-too-familiar red Close button in the upper-right corner of the dialog box. Every time you create a UserForm, this button is automatically included in the title bar. However, you can intercept it with a message box.
To di[...]