Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


How to interupt a progress bar


How to interupt a progress bar

Author
Message
Catman
Catman
Forum God
Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)Forum God (680 reputation)

Group: Forum Members
Posts: 2, Visits: 13

I have a splash screen that appears when Excel is opened.  Normally it disappears after a few seconds and a progress bar shows time remaining.   I want to be able to stop the splash screen from disappearing so I added a command button to the splashscreen (form) labeled "pause", if  clicked I should temporarily stop the progress bar and allow the splashscreen to remain in view.  Here’s what I have so far:

 

1.  An Open event (for Workbook) brings the splashscreen into view:    

 

Private Sub Workbook_Open()

SplashScreen.Show

End Sub

 

2.  The form code (for splash screen) does this:

 

Private Sub UserForm_Activate()

Dim dTime As Date

Dim i As Integer

For i = 1 To 100 Step 15

dTime = Now + TimeValue("0:00:01")

Application.Wait TimeValue(dTime)

ProgressBar1.Value = i

Next i

Call EndSplash

End Sub

 

3.  The For i loop delays the call of EndSplash for ~5 seconds.  While the loop is executing I think I need to check the state of a command button to see if the user has clicked it (or not), just not sure how to do this.  Well that's my though, maybe I am in left field and there is a better method, the main point is, how to temporarily stop the slash screen from dissapearing automatically.   Appreciate any help and thanks in advance.

 

 

 

Edited
11/13/2008 by Catman
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search