ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel losing focus and non-updating userforms (https://www.excelbanter.com/excel-programming/389750-excel-losing-focus-non-updating-userforms.html)

mo_in_france[_2_]

Excel losing focus and non-updating userforms
 
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.


Tom Ogilvy

Excel losing focus and non-updating userforms
 
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

--
Regards,
Tom Ogilvy


"mo_in_france" wrote:

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.




All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com