Hey guys.
I've got a userform with a few different refedit objects, and if one of the refedit objects is in focus, or in use, when the user presses the cancel button to close the form the form will close, but Excel becomes stuck in a "select a cell" mode for the previously in focus refedit.
The form closes properly if the text input object is in focus, just not when a refedit is.
The cancel button is one I made, that simply clears all field values and then hides the user form. I've tried setting the focus to the text input object before hiding the form, but the same problem occurs. I've also replaced the userform.hide call with a "Unload userform" call, but the problem persists.
To clarify; if user form.hide is used, the userform window closes and excel is stuck trying to select a range until you force quit the program. If "Unload userform" is used, then the userform window closes, and Excel will crash upon the next mouse click.
Any ideas?
Thanks,
Tim
I've got a userform with a few different refedit objects, and if one of the refedit objects is in focus, or in use, when the user presses the cancel button to close the form the form will close, but Excel becomes stuck in a "select a cell" mode for the previously in focus refedit.
The form closes properly if the text input object is in focus, just not when a refedit is.
The cancel button is one I made, that simply clears all field values and then hides the user form. I've tried setting the focus to the text input object before hiding the form, but the same problem occurs. I've also replaced the userform.hide call with a "Unload userform" call, but the problem persists.
To clarify; if user form.hide is used, the userform window closes and excel is stuck trying to select a range until you force quit the program. If "Unload userform" is used, then the userform window closes, and Excel will crash upon the next mouse click.
Any ideas?
Thanks,
Tim