Screen Updating For Status Bar

D

DownThePaint

I have a VBA routine that keeps the user updated on progress by changing the
status bar (Processing xxx Row of yyyy). When the user multi tasks and goes
to do something else and then comes back to Excel the status bar updating is
frozen. I have the Application.ScreenUpdating set to TRUE.

Any Ideas?
 
M

Mike H

As long as you pick up the value of XXXX in a variable as your code loops
then try

Application.StatusBar = xxxx



Mike
 
D

DownThePaint

Hi Mike;

I am doing that with the code now. As long as the user keeps the
application focus on Excel the updating works but if they say, go check email
and then come back when Excel regains focus the status bar does not update
even thought the routine is successfully running in the back ground.

Thanks,
 
P

Peter T

I can't recreate your problem. IOW the status bar will update no matter what
you do, or don't do, even if screenupdating is disabled.

Try the following 20 second loop, switch app's back & forth hiding revealing
windows etc.

Sub test()
Dim d As Date
Dim db As Date, Begin As Date, Current As Date
Const SEC As Date = 1 / 24 / 60 / 60

' Application.ScreenUpdating = False

Begin = Now

Do ' loop for 20 seconds updating the statusbar
Current = Now
If Application.StatusBar <> CStr(Current) Then
Application.StatusBar = CStr(Current)
End If
Loop Until Current > (Begin + 20 * SEC)


MsgBox "done"
Application.StatusBar = False
Application.ScreenUpdating = True

End Sub

Regards,
Peter T
 

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

Similar Threads


Top