Excel losing focus and non-updating userforms

M

mo_in_france

Hello All,

I've a number of Excel VBA applications which require user input/
response, and I've got 2 commonly occurring issues, relating to what
maybe the same thing

(1) Dropdown comboxbox on a userform -
The user must select an item from a combobox, then the user then must
select another item from combobox (containing 10 items at least). My
problem, is that when the second combobox appears you can still see
the previous dropdown list (in its expanded form) on the screen.
Despite a combination of 'Unload' and screen updates, the original
dropdown list stays visible.
I'm pretty sure Im missing something stupidly obvious here.

(2) When msgbox appears, Excel loses focuses
When a msgbox appears, typically at the end of the program, when I
display something that indicates the end of the program, Excel loses
focus. That's to say, another program takes focus, and the Excel icon
on the application bar starts to flash, suggesting that Excel wants
you to click okay on the msgbox.
This seems to occur more on some users than others.

Any suggestions would be very helpful.
 
G

Guest

for the first, do you have screenupdating set to false?

Perhaps you answered that with this statement:
Despite a combination of 'Unload' and screen updates,

But that is the usual cause

In addition, you might be showing a second userform from the first. Once
you do

Userform2.Show from a click event in the first userform, no more code
will run in the first useform until the second userform is unloaded or
hidden.

YOu might use

Private Sub combobox1_Click()
me.Hide
doevents
userform2.show
' if the first userform is done then perhaps
unload me
End Sub
 

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

Top