Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've had this problem and found changing focus helps:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If ActiveControl.Name = "MyRefEdit" Then NamesListBox.SetFocus End Sub Doing it in the terminate event is too late I believe. -- Jim "Pflugs" wrote in message ... |I created a userform that contains a RefEdit, several textboxes, and a 'Done' | button. The form is initialized with the RefEdit as the focus. The form | also has a checkbox that when clicked modifies the width to reveal a second | set of controls. | | Sometimes when I click 'Done' to close the form, the RefEdit's selection | retains control. That is, the status bar says "Point" and the ants are | marching around the selection. When this happens, the macro continues to run | and Excel becomes confused and eventually crashes. | | I'm not sure why this is happening. I have even used | "Application.CutCopyMode = False" on Terminate, and that doesn't seem to take | care of all problems. I have also tried cleaning the code with Rob Bovey's | Code Cleaner. Any other suggestions? | | Thanks, | Pflugs |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To refedit, or not to refedit, that is the question. | Excel Programming | |||
Textbox Validation not retaining focus | Excel Programming | |||
Retaining focus on a textbox / listbox item pair after validation = false. | Excel Programming | |||
RefEdit | Excel Programming | |||
RefEdit | Excel Programming |