View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2195_] Rick Rothstein \(MVP - VB\)[_2195_] is offline
external usenet poster
 
Posts: 1
Default How to desensitize the "X" on Inputboxs, Textboxes and other gui's

Rather than "desensitize" the "X", you should allow the user to do that
(it's a common Windows thing to do) and set up your code to handle the
action. If you are running from a UserForm, use the UserForm_QueryClose
event to perform whatever clean-up code you now perform when your users
click your current ExitButton/ExitMenuItem/etc. By the way, to answer your
question, setting Cancel = True in this event will "desensitize" the "X" for
you (but I strongly suggest you not do this as it makes your code seem
unprofessional). If you are not using a UserForm, then put your clean-up
code in the Workbook_BeforeClose (this event kicks off when the user closes
Excel itself).

Rick


wrote in message
...
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