Progress Bar Internet Connection

S

sgl

Hi all,

I am using Office 2003. I am trying to develop a routine with a Progress Bar
that ping pongs until connection is made with the relevant URL. Once
connection made and URL activated the StopFlag should be set to TRUE at which
stage we exit the Ping Pong Progress bar and the application should continue
with the rest of the code.

How do I call and develop a Function for the StopFlag to show TRUE

I have the following progress bar routine.

Option Explicit
Dim sngPercent As Single
Dim StopFlag As Boolean
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Public Sub StartProgress()
sngPercent = 0

'When starting the flag is set false
StopFlag = False

Do Until sngPercent = 100

'If StopFlag changes to true then exit sub
If StopFlag = True Then
sngPercent = 100
Exit Sub
End If

ProgressStyle sngPercent
DoEvents

sngPercent = sngPercent + 1
Sleep 100

' This is what makes it all work going around continuously!
If sngPercent = 100 Then
sngPercent = 0
End If
Loop

End Sub

Public Sub ProgressStyle(Percent As Single)

Dim strTemp As String
Dim intIndex As Integer

intIndex = Int((Percent * 100) Mod (Len(WebProgressBar!Label2.Caption) +
1))
strTemp = String(Len(WebProgressBar!Label2.Caption), " ")
If intIndex > 0 Then
Mid(strTemp, intIndex, 1) = "•"
End If
WebProgressBar!Label3.Caption = strTemp

End Sub

Many thanks/sgl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top