View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default application.statusbar updates freeze

You could try adding doEvents in your code. It'll allow the operating system a
little time to do what it needs to do.

You could even do it every so often (depending on what else you do in your real
loop).

Dim r As Long
For r = 1 To 60000
Application.StatusBar = "processing row " & r
If r Mod 50 = 0 Then
DoEvents
End If
Next r

Robert Flanagan wrote:

I have some code that updates the statusbar with the row number being
processed. Sometimes this update freezes but the code keeps running. Is
there a way to force the statusbar to update all the time?

For example

For r = 1 to 60000
application.statusbar "processing row " & r
next

will freeze. I've tried doing it every 10, 20, 100 rows and it will still
freeze. I can do a ctl-break and resume, but I don't want users to do that
obviously.


--

Dave Peterson