Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Progress bar freeze while running code

Dear experts,
I have a user form in my VBA code which contains a label and progress
bar to show the user the percent of calculations completion (label
shows the percent of completion).
When the number of calculations is too high, sometimes the label and
progress bar seems to freeze but the calculations actually continues
and I get the right results. This problem doesn't happen always (even
for same calculations).
Any help?
Best regards,
Reza

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Progress bar freeze while running code

Try adding the line,

UserForm1.Repaint

after each iteration/calculation - probably best in a loop.


rezafloyd wrote:
Dear experts,
I have a user form in my VBA code which contains a label and progress
bar to show the user the percent of calculations completion (label
shows the percent of completion).
When the number of calculations is too high, sometimes the label and
progress bar seems to freeze but the calculations actually continues
and I get the right results. This problem doesn't happen always (even
for same calculations).
Any help?
Best regards,
Reza


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Progress bar freeze while running code


JakeyC wrote:
Try adding the line,

UserForm1.Repaint

after each iteration/calculation - probably best in a loop.


Dear JakeyC,
Thank you for reply.
I've already done it, but no use.
Regards,
reza

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Progress bar freeze while running code

Hmmm - have you tried DoEvents?


rezafloyd wrote:
JakeyC wrote:
Try adding the line,

UserForm1.Repaint

after each iteration/calculation - probably best in a loop.


Dear JakeyC,
Thank you for reply.
I've already done it, but no use.
Regards,
reza


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Progress bar freeze while running code

Dear JakeyC,
Could you please kindly give me more information about DoEvents and
how can I use it?
I saw the Excel help file but it wasn't clear for me.
Thanks
Reza

JakeyC wrote:
Hmmm - have you tried DoEvents?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Progress bar freeze while running code

Basically, DoEvents can be called as a function, but used as below, it
allows the operating system to process anything that may be queued up -
especially during a long-running macro where CPU usage is constantly at
or near 100%.

Use it as in

For i = 1 to 100

<Lots of calculations

DoEvents

Next i


It's a longshot but worth a try.


rezafloyd wrote:
Dear JakeyC,
Could you please kindly give me more information about DoEvents and
how can I use it?
I saw the Excel help file but it wasn't clear for me.
Thanks
Reza

JakeyC wrote:
Hmmm - have you tried DoEvents?



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
progress box while macro is running [email protected] Excel Programming 2 October 25th 05 10:39 AM
how do you set up a progress bar when running a macro in excel? Neil Hopkinson Excel Programming 8 April 3rd 05 10:41 PM
Show progress in a user form while code runs Bura Tino Excel Programming 2 April 15th 04 06:18 AM
Code for a progress dialog?? lifter10101010 Excel Programming 2 November 10th 03 03:47 PM
VBA code to make a progress tool bar work Jeff Marshall Excel Programming 2 October 11th 03 11:18 PM


All times are GMT +1. The time now is 06:40 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"