Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Form Repainting Problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Form Repainting Problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Form Repainting Problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Form Repainting Problem

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
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
Repainting a Workbook cincode5 Excel Discussion (Misc queries) 1 January 22nd 05 01:04 AM
Problem about Form.... ªü¤T[_2_] Excel Programming 3 November 13th 04 06:49 AM
form problem inquirer Excel Programming 5 November 12th 04 01:31 PM
refreshing or repainting worksheet AlexD Excel Programming 1 May 21st 04 06:22 PM
Excel VBA Form problem Matt000 Excel Programming 2 February 19th 04 06:16 PM


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