VBA in Excel

Copper Contributor

Dear Sir/Madam, 

 

I have an end user who claims that Excel freezes & crashes when 

 the typical point where it is freezing is  when student use an incorrect "(Name)" and get an error message.  This may be as a result of accidental keyboard click (as opposed to  misunderstanding the rules) and the error message pops up and  freezes excel completely - therefore just trying to avoid the  errorsisn't an ideal solution.
This error should - just pop up a warning, you click "ok" and the  software reverts to original name which you can rename again - with  no lag. The light level programming we are currently doing seems to  run fine without freezing, but error messages are stalling the  software. 
Any suggestions?
Michael.
2 Replies

where do you make the name check? on change event or on exit event or when you press a button? if you want to control the false inputs from the user it is best to make this control when the related textbox looses focus or when the user press a button. So that you can write a code to eliminate the invalid characters from the name or delete the contents of the textbox and select it for user to enter correct name.

 

If you are making this control on exit event it is better to exclude some special characters however the code can be a little bit tricky.

Thanks Erol, I was reporting someone else's issue, but I will ask them to try your suggestion. Michael.