![]() |
I need to disable to X on a user form
I can't figure out how to prevent someone from clicking the close (X) icon on
a user form. I have a cancel button which is what I want them to have to use. thanks |
How about:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Beep 'msgbox "doesn't work" Cancel = True End If End Sub cwwolfdog wrote: I can't figure out how to prevent someone from clicking the close (X) icon on a user form. I have a cancel button which is what I want them to have to use. thanks -- Dave Peterson |
Thanks Dave,
Worked like a charm. "Dave Peterson" wrote: How about: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Beep 'msgbox "doesn't work" Cancel = True End If End Sub cwwolfdog wrote: I can't figure out how to prevent someone from clicking the close (X) icon on a user form. I have a cancel button which is what I want them to have to use. thanks -- Dave Peterson |
All times are GMT +1. The time now is 10:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com