Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Force Excel to Refresh Screen

I have a macro which goes through a "for loop" for a large number of
loops and it takes several hours to finish running. I output the number
the run has gone up to in the status bar to show the progress.

Whenever I click away from Excel to another application or when the
screensaver kicks in and I move the mouse again, I get a white screen
in Excel which I can see neither the worksheet nor the status bar. I am
not turning off screen updating in my code.

Does anybody know whether there is a way to get Excel to refresh the
screen (or at least the status bar) during an intensive calculation?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Force Excel to Refresh Screen

Hi,

just a few thoughts:

you should turn off screenupdating as this will speed up your code.
From time to time, eg. when the statusbar changes, you can turn on
screenupdating and then immediately turn it off again so that you can
see what is going on. I dont know if this will also solve your problem
when switching back to excel from another application.

arno

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Force Excel to Refresh Screen

As I understand it, it is one thing to allow Excel to update itself with
..ScreenUpdating, but another to allow processing of the message queue from
Windows, as in the Paint message that will be received when Excel is
reshown. Adding a DoEvents at suitable intervals will help with this.

NickHK

"Ming" wrote in message
oups.com...
I have a macro which goes through a "for loop" for a large number of
loops and it takes several hours to finish running. I output the number
the run has gone up to in the status bar to show the progress.

Whenever I click away from Excel to another application or when the
screensaver kicks in and I move the mouse again, I get a white screen
in Excel which I can see neither the worksheet nor the status bar. I am
not turning off screen updating in my code.

Does anybody know whether there is a way to get Excel to refresh the
screen (or at least the status bar) during an intensive calculation?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Force Excel to Refresh Screen

Hello,

Try using DoEvents inside your code to instruct Excel to execute other
tasks while running your code.

I hope this helps.

Regards,
Karim

arno wrote:
Hi,

just a few thoughts:

you should turn off screenupdating as this will speed up your code.
From time to time, eg. when the statusbar changes, you can turn on
screenupdating and then immediately turn it off again so that you can
see what is going on. I dont know if this will also solve your problem
when switching back to excel from another application.

arno


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
Force charts to refresh? Chrisso Charts and Charting in Excel 2 June 16th 09 11:38 AM
Excel Screen Refresh Issue in Terminal Server Denis Excel Discussion (Misc queries) 0 February 11th 08 07:26 AM
force numbers as text as seen on screen craig331 Excel Discussion (Misc queries) 1 April 5th 06 01:53 AM
supress screen refresh when macros running in excel VB drstraw Excel Programming 3 August 26th 05 04:25 AM
Force refresh of custom functions donesquire Excel Worksheet Functions 5 May 11th 05 07:36 PM


All times are GMT +1. The time now is 11:40 PM.

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

About Us

"It's about Microsoft Excel"