Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
progress box while macro is running | Excel Programming | |||
how do you set up a progress bar when running a macro in excel? | Excel Programming | |||
Show progress in a user form while code runs | Excel Programming | |||
Code for a progress dialog?? | Excel Programming | |||
VBA code to make a progress tool bar work | Excel Programming |