Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ProgressBar control displays erratically on Open | Excel Worksheet Functions | |||
ProgressBar Control | Excel Discussion (Misc queries) | |||
Nelp required to integrate ProgressBar | Excel Discussion (Misc queries) | |||
Sync Worksheets in Different Workbooks | Excel Worksheet Functions | |||
Can I sync worksheets within a document? | Excel Discussion (Misc queries) |