UserForms - disabling the little x

J

JimBo

I have forgotten how to disable the little x (top right of a user form) will
someone prompt me please

TIA



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4178 (20090622) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
P

Patrick Molloy

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = True
End Sub
 
J

JimBo

Thanks Patrick - Muchly appreciated

Patrick Molloy said:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = True
End Sub




__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4178 (20090622) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4178 (20090622) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
P

Peter T

Just to add, to prevent close if user clicked the little x but allow the
form to close with other ways

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
msgbox "don't close with the little x"
else
Msgbox "bye"
end if
End Sub

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top