Disable close button on all froms & MsgBoxes
Is there a way to disable/hide/something the close buttons in all userforms
and msgboxes in a workbook? If not can you individually disable/hide them in userforms? MsgBoxes? |
Disable close button on all froms & MsgBoxes
On user forms try...
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True 'Chg msg text to fit your needs... MsgBox "Please use the ''OK'' Button.", vbInformation End If End Sub -- Thx MSweetG222 "Haxer" wrote: Is there a way to disable/hide/something the close buttons in all userforms and msgboxes in a workbook? If not can you individually disable/hide them in userforms? MsgBoxes? |
Disable close button on all froms & MsgBoxes
Thank you...
Do you know if there is a way to globalize this so that I can put it in once and it will work for all userforms? "MSweetG222" wrote: On user forms try... Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True 'Chg msg text to fit your needs... MsgBox "Please use the ''OK'' Button.", vbInformation End If End Sub -- Thx MSweetG222 "Haxer" wrote: Is there a way to disable/hide/something the close buttons in all userforms and msgboxes in a workbook? If not can you individually disable/hide them in userforms? MsgBoxes? |
All times are GMT +1. The time now is 08:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com