Restrict dialog box closing

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

Is there any way to prevent a user from closing a dialog box by clicking on
the X in the upper right corner?
 
try this but make sure you have another method to dismiss the form:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode <> 1 Then
Cancel = 1
msg = MsgBox("Please Use Cancel Button", 16, "Warning")
End If
End Sub
 

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.

Ask a Question

Back
Top