
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...