ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help with Userforms (https://www.excelbanter.com/excel-discussion-misc-queries/101160-help-userforms.html)

Panagiotis Marantos

Help with Userforms
 
Hello

just a quick question about userforms.

i want to disable the close button on the top right

how can i do that???

Tom Hutchins

Help with Userforms
 
Add the macro below to the userform code module:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "You can't close the dialog like this!"
End If
End Sub

Here is where I got that code:
http://www.erlandsendata.no/english/...gspreventclose

Hope this helps,

Hutch

"Panagiotis Marantos" wrote:

Hello

just a quick question about userforms.

i want to disable the close button on the top right

how can i do that???


Panagiotis Marantos

Help with Userforms
 
that works perfect

thanks for that

i was trying to find something in the userform porperties similarly to the
access forms properties.

never though to prevent by code

"Tom Hutchins" wrote:

Add the macro below to the userform code module:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "You can't close the dialog like this!"
End If
End Sub

Here is where I got that code:
http://www.erlandsendata.no/english/...gspreventclose

Hope this helps,

Hutch

"Panagiotis Marantos" wrote:

Hello

just a quick question about userforms.

i want to disable the close button on the top right

how can i do that???



All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com