Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ProgressBar Out of Sync

Hope you can help, I have created a UserForm with multiple
CommandButtons, each CommandButton runs a lengthy Macro.
The Code for the Macro is running inside a loop that
updates a ProgressBar. I have this process running perfectly.
After you click the CommandButton, the Macro is in perfect
sync with the completion of the ProgressBar reaching 100%,
except that when the Userform that displays the ProgressBar
is instructed to unload, it unloads leaving a white area
where the UserForm was. The white area doesn't completely
disappear until the worksheet updates all of the changes,
about 12 seconds.
How can I make the UserForm remain displayed with the 100%
finished ProgressBar while the worksheet finishes it's 12
seconds of updating?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default ProgressBar Out of Sync

You could try
Application.Calculate
then unload progressbar

Or ...

Adapt the following code, of course the wait one second would be unnecessary
and you would have to calculate "i" yourself which you probably already do
anyway. I can't take credit for this code as one of the Gurus had it on his
site and gave credit again to someone else. Good Luck :)

Sub ProgressBarSimpleDemo()
Dim sb As clsProgressBar, i As Long
Set sb = New clsProgressBar ' create a new progress bar
sb.Show "Please wait", vbNullString, 0 ' display the progress bar
For i = 0 To 100 Step 20
sb.PercentComplete = i ' update the progress bar
WaitSeconds 1
Next i
Set sb = Nothing ' remove the progress bar
End Sub

Private Sub WaitSeconds(waitTime As Integer)
Application.Wait (Now + TimeValue("00:00:" & Format(waitTime, "00")))
End Sub


--
Regards,
Rocky McKinley


"RDallas" wrote in message
...
Hope you can help, I have created a UserForm with multiple
CommandButtons, each CommandButton runs a lengthy Macro.
The Code for the Macro is running inside a loop that
updates a ProgressBar. I have this process running perfectly.
After you click the CommandButton, the Macro is in perfect
sync with the completion of the ProgressBar reaching 100%,
except that when the Userform that displays the ProgressBar
is instructed to unload, it unloads leaving a white area
where the UserForm was. The white area doesn't completely
disappear until the worksheet updates all of the changes,
about 12 seconds.
How can I make the UserForm remain displayed with the 100%
finished ProgressBar while the worksheet finishes it's 12
seconds of updating?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default ProgressBar Out of Sync

The white area could be the result of the code

Application.ScreenUpdating=False

somewhere. Try putting in the code Application.ScreenUpdating=TRUE
right before you unload the form.


"RDallas" wrote in message ...
Hope you can help, I have created a UserForm with multiple
CommandButtons, each CommandButton runs a lengthy Macro.
The Code for the Macro is running inside a loop that
updates a ProgressBar. I have this process running perfectly.
After you click the CommandButton, the Macro is in perfect
sync with the completion of the ProgressBar reaching 100%,
except that when the Userform that displays the ProgressBar
is instructed to unload, it unloads leaving a white area
where the UserForm was. The white area doesn't completely
disappear until the worksheet updates all of the changes,
about 12 seconds.
How can I make the UserForm remain displayed with the 100%
finished ProgressBar while the worksheet finishes it's 12
seconds of updating?

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
ProgressBar control displays erratically on Open circuit_breaker Excel Worksheet Functions 0 July 10th 09 12:33 PM
ProgressBar Control Ayo Excel Discussion (Misc queries) 3 October 18th 08 07:24 AM
Nelp required to integrate ProgressBar Ola2B Excel Discussion (Misc queries) 0 July 20th 07 03:06 PM
Sync Worksheets in Different Workbooks FP Novice Excel Worksheet Functions 1 May 9th 07 06:46 PM
Can I sync worksheets within a document? Brenda Excel Discussion (Misc queries) 1 February 8th 07 11:57 PM


All times are GMT +1. The time now is 07:40 AM.

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"