If you want to prevent a user from closing the userform via the "x" just use
sub UserForm_QueryClose:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub
CloseMode is 0 when a userform is manually closed and 1 when closed through
code like this:
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
--
Jim
| hi all, is it possible to hide thew close button on a form ? If so how
| does one do it ?
|
| Les Stout
|
|
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.