how to prevent user from closing User form

A

acherony

HI!,

I made one template macro using Autonew()
Which start UserForm.

I need to prevent/block the User from closing the UserForm with close button
of
Windows from UserForm.

Need Disable Windows close button of Window.

need help
 
K

Kodeworks

acherony

Try using the QueryClose event of your userform. It fires before the
UserForm closes and you can detect what's trying to close your
userform.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
End Sub



Sunil Jadwani
Kodeworks - Business Automation Solutions
www.kodeworks.com
 

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