Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a label on a form that I use to show the progress of a loop. It works
great except if I change the focus to a different application and then return to excel. Doing so freezes the label where it was when I changed the focus. Is there a to get the form to start refreshing again? Thanks For i = 1 To LastRow lblStatus.Caption = i & " of " & LastRow frmStatus.Repaint ...the rest of the loop Next i |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps
For i = 1 To LastRow lblStatus.Caption = i & " of " & LastRow frmStatus.Repaint doevents ...the rest of the loop Next i -- Regards, Tom Ogilvy "ybazizi" wrote in message ... I have a label on a form that I use to show the progress of a loop. It works great except if I change the focus to a different application and then return to excel. Doing so freezes the label where it was when I changed the focus. Is there a to get the form to start refreshing again? Thanks For i = 1 To LastRow lblStatus.Caption = i & " of " & LastRow frmStatus.Repaint ...the rest of the loop Next i |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The DoEvents did the trick. Thanks!
"Tom Ogilvy" wrote: Perhaps For i = 1 To LastRow lblStatus.Caption = i & " of " & LastRow frmStatus.Repaint doevents ...the rest of the loop Next i -- Regards, Tom Ogilvy "ybazizi" wrote in message ... I have a label on a form that I use to show the progress of a loop. It works great except if I change the focus to a different application and then return to excel. Doing so freezes the label where it was when I changed the focus. Is there a to get the form to start refreshing again? Thanks For i = 1 To LastRow lblStatus.Caption = i & " of " & LastRow frmStatus.Repaint ...the rest of the loop Next i |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't know how useful this is but I found pausing the application works with
things like this, this will pause the loop for half a second that usaully is more than enough time for the computer to refresh Dim PauseTime, Start, Finish For i = 1 To LastRow PauseTime = 0.5 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime Loop Finish = Timer ' Set end time. lblStatus.Caption = i & " of " & LastRow frmStatus.Repaint ...the rest of the loop Next i -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200601/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Repainting a Workbook | Excel Discussion (Misc queries) | |||
Problem about Form.... | Excel Programming | |||
form problem | Excel Programming | |||
refreshing or repainting worksheet | Excel Programming | |||
Excel VBA Form problem | Excel Programming |