How to disable the close button from a form 
Author Message
 How to disable the close button from a form

Good morning all,

1.) I need a way to disable the close button in the upper right hand corner
of the form.  If possible, I would like to eliminate it altogether.

2) Is there a way to prohibit the application from opening if the user
chooses to 'disable the macros' when Excel first opens?  I realize that the
option is there to protect the PC from running any possible harmful viruses,
so this issue may not be addressable.

3) I cannot find the code to close the entire excel application using a
command button.

4) Is there a way to hide the code from the user if he/she does disable the
macros or close the form using the 'X' button in the upper right hand
corner?

Thank you...



Tue, 21 Oct 2003 21:15:13 GMT  
 How to disable the close button from a form
Tom,

1)  I dont think you can elimate it altogether, but this will disable it.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = vbFormControlMenu Then
        MsgBox "You can't exit this way, try the exit button."
        Cancel = True
    End If
End Sub

2)  Check in your options for this.  General, then disable Check for macro
virus protection.

3) Application.Quit

4) When you disable the "X", it shouldn't go back into the VB editor.

Hope this helps, and if you need anymore help let me know!

dave

Quote:
> Good morning all,

> 1.) I need a way to disable the close button in the upper right hand
corner
> of the form.  If possible, I would like to eliminate it altogether.

> 2) Is there a way to prohibit the application from opening if the user
> chooses to 'disable the macros' when Excel first opens?  I realize that
the
> option is there to protect the PC from running any possible harmful
viruses,
> so this issue may not be addressable.

> 3) I cannot find the code to close the entire excel application using a
> command button.

> 4) Is there a way to hide the code from the user if he/she does disable
the
> macros or close the form using the 'X' button in the upper right hand
> corner?

> Thank you...



Wed, 22 Oct 2003 01:43:00 GMT  
 How to disable the close button from a form
Thanks Dave
Quote:

>Tom,

>1)  I dont think you can elimate it altogether, but this will disable it.

>Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
>    If CloseMode = vbFormControlMenu Then
>        MsgBox "You can't exit this way, try the exit button."
>        Cancel = True
>    End If
>End Sub

>2)  Check in your options for this.  General, then disable Check for macro
>virus protection.

>3) Application.Quit

>4) When you disable the "X", it shouldn't go back into the VB editor.

>Hope this helps, and if you need anymore help let me know!

>dave


>> Good morning all,

>> 1.) I need a way to disable the close button in the upper right hand
>corner
>> of the form.  If possible, I would like to eliminate it altogether.

>> 2) Is there a way to prohibit the application from opening if the user
>> chooses to 'disable the macros' when Excel first opens?  I realize that
>the
>> option is there to protect the PC from running any possible harmful
>viruses,
>> so this issue may not be addressable.

>> 3) I cannot find the code to close the entire excel application using a
>> command button.

>> 4) Is there a way to hide the code from the user if he/she does disable
>the
>> macros or close the form using the 'X' button in the upper right hand
>> corner?

>> Thank you...



Wed, 22 Oct 2003 02:46:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help with disabling the close button on a form

2. Disable Access Close Button not Form Close Button?

3. Disabling Close button on form

4. Help - Can't disable close button on user form title bar

5. Disable Min/Max/close buttons in a form

6. Disabling close button on maximized form - How?

7. Disabling the close button on a form.

8. Disable close button on maximized forms

9. Disable Close, Restore Buttons on Maximized Form

10. Disable close button on forms


 
Powered by phpBB® Forum Software © phpBB Group