ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP! - Closing form (https://www.excelbanter.com/excel-programming/310108-re-help-closing-form.html)

Alex J

HELP! - Closing form
 
K,
The following example was posted in the news group in March. (Try Google
Search on the newsgroup - great for getting past knowledge).

Private Sub UserForm_QueryClose(Cancel As Integer, Closemode As Integer)
If Closemode = vbFormControlMenu Then
MsgBox "Please Click The Exit Button To Close The File."
Cancel = True
End If
End Sub

Regards,
AlexJ


"Katie" wrote in message
...
I have a few forms in Excel that I do not want the user to be able to

close
without going through the questions asked on the form. As I have it

running
now, a user can click the "x" in the top right hand corner and the form

will
close. How do I disable this? thank you! I am frustrated - this is the

last
thing I need to figure out and I am sure it is so easy, but I can NOT

figure
it out! Thank you!




Katie

HELP! - Closing form
 
Thank you it worked!!

"Alex J" wrote:

K,
The following example was posted in the news group in March. (Try Google
Search on the newsgroup - great for getting past knowledge).

Private Sub UserForm_QueryClose(Cancel As Integer, Closemode As Integer)
If Closemode = vbFormControlMenu Then
MsgBox "Please Click The Exit Button To Close The File."
Cancel = True
End If
End Sub

Regards,
AlexJ


"Katie" wrote in message
...
I have a few forms in Excel that I do not want the user to be able to

close
without going through the questions asked on the form. As I have it

running
now, a user can click the "x" in the top right hand corner and the form

will
close. How do I disable this? thank you! I am frustrated - this is the

last
thing I need to figure out and I am sure it is so easy, but I can NOT

figure
it out! Thank you!






All times are GMT +1. The time now is 12:44 PM.

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