Загрузка...

How to disable the close button on UserForm in Excel VBA

The QueryClose event in Visual Basic.
How to disable the close button on UserForm in Excel VBA?
Prohibiting the user from using the Close command from the Control menu on the UserForm.

If the user has chosen the Close command from the Control menu on the UserForm, the "CloseMode" should be assigned with the constant "vbFormControlMenu" which is equivalent to a value of "0".
Eg. CloseMode = vbFormControlMenu or CloseMode = 0.

To stop the QueryClose event in all loaded UserForm's and prevent them from closing, the argument "Cancel" should be set to any value other then "0".
Eg. Cancel = 1, Cancel = True or Cancel = 2.

Excel & VBA discussion public group 👉 https://www.facebook.com/groups/486402069483674
Welcome to join and feel free to raise/ask questions (if any) or share Excel tricks 🤗

#excel #vba

Видео How to disable the close button on UserForm in Excel VBA канала Ah Sing Excel TV
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять