I found DoEvents not always completely reliable. I would suggest trying two different things.
First, try placing a DoEvents call immediately after updating the status bar (that is, before your Some code .... ).
If this does not work, I found that in some cases using the Sleep API is a more reliable way to get CPU time. This is usually the first thing I try to do if DoEvents does not work as I would like. You need to add the following line at the top of your module (outside your function):
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Then add this line instead of or DoEvents :
Sleep 1 'This will pause execution of your program for 1 ms
Perhaps you will try to increase the program pause time using sleep if 1 ms does not work.
mwolfe02
source share