View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Alan is offline
external usenet poster
 
Posts: 152
Default How to desensitize the "X" on Inputboxs, Textboxes and other gui's

This might be too late for you, but here is code to stop the user from
closing with the "X". This is for a userform; you didn't mention if that was
the case or not.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the OK button." 'Change message to suite.
End If
End Sub


Alan



" wrote:

Good morning!

I find myself without my VBA bible, it is at work and I am at
home....in it was a method to desenitize the "X" found on various
boxes that can be build via VBA. To my horror I have found several
field type people (read that as users) who are using this 'X' and
blowing up my VBA utility.

Can some one offer the fix for this that I can't quite remember and
put me out of my misery?

Thanks

Wayne