sidwelle
asked on
VBA Userform looses focus to worksheet in Excel
VBA UserForm looses focus.
I have developed a few Macros/applications in VBA that make use of a UserForm.
Problem: During testing I find that after I start application, the form looses focus and/or minimizes or a worksheet from the workbook takes focus. Form is no longer in view !
Either way, the form is still alive and normalized, I just have to go hunting for it.
The form does not show an Icon in the taskbar, so I usually find it by clicking on one of the worksheets that are open from the taskbar and it shows up w/focus in front of one of the Worksheet(s).
Can anyone shed light on why it is doing this ?
Thanks
ASKER
That appears to have worked. I had that set to Non-Modal so that I could get behind the form and look at the worksheet if I needed to after the form was loaded.
I guess the users will have to stop and app if they want to look up values from the WS.
Thanks
I guess the users will have to stop and app if they want to look up values from the WS.
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
you'd have to post your workbook for us to take a closer look at.
Check the properties of the User Form. ShowModal property needs to be set to True for it to keep focus until it is closed.
ShowModal property (Visual Basic for Applications) | Microsoft Learn