How to desensitize the "X" on Inputboxs, Textboxes and other gui's

  • Thread starter Thread starter wagee
  • Start date Start date
W

wagee

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
 
http://peltiertech.com/WordPress/2008/03/31/repurpose-the-red-x-close...

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______








- Show quoted text -
Thanks Jon but I really do want to make the X not active in a similar
manner as to when options are set to vbYesNo. This is mostly an issue
with inputbox I think. I can use your suggestions for other userforms.
Thanks for helping however.

Wayne
 
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
 

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