This stops the window being closed and shows a msg
James
Private Sub UserForm_QueryClose(Cancel As Integer,
CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
MsgBox "Please use the Exit button", vbCritical
End If
End Sub
Thank you. but to explain a little further, i was trying to remove the
button altogether (or disable it, so clicking has no effect), later code in
the module will close it automatically
thank you, i got the desired effect using the QueryClose event of the button
(don't know if its the best way though). the button is still there, but
clicking now has no apparent effect.
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.