Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default application.statusbar updates freeze

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default application.statusbar updates freeze

Thanks Dave. I ust did what you suggested. And added a lot of different
screen activity. I ended up doing something like:

if rnd() .995 then
statusbar and doevents and select cell
end if

which kept the screen changing. Problably slowed things down by 10-20% but
no one will complain.

Bob
"Dave Peterson" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default application.statusbar updates freeze


I'm not sure why you're selecting the cell. There's not that many things that
need to have a specific cell selected.

And don't forget to turn calculation to manual, screenupdating to off, do the
work, calc back to automatic (or whatever it was before) and screenupdating to
on.

Robert Flanagan wrote:

Thanks Dave. I ust did what you suggested. And added a lot of different
screen activity. I ended up doing something like:

if rnd() .995 then
statusbar and doevents and select cell
end if

which kept the screen changing. Problably slowed things down by 10-20% but
no one will complain.

Bob
"Dave Peterson" wrote in message
...
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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 freeze panes won't freeze top row only macbone2002 Excel Discussion (Misc queries) 3 April 22nd 23 02:07 AM
Application.StatusBar or equivalent for user defined functions Bob Nyholm Excel Programming 3 April 18th 08 08:52 PM
Statusbar Matts Excel Programming 3 December 6th 07 12:20 PM
Application.StatusBar not refreshing after ThisWorkbook.Close LEO@KCC Excel Programming 6 September 12th 07 10:41 AM
How to reset the Application.StatusBar PCLIVE Excel Programming 7 August 1st 06 05:18 PM


All times are GMT +1. The time now is 01:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"