I have been reading through stackoverflow on how to use progressbar.
It works fine , but after a short time 6%, row 14 in my array of 235 it says not responding, and does so until the loop finishes.
So I am running it vbmodeless:
ProgressBar.Show vbModeless
ProgressBar.Label_WhatsGoingOn.Caption = "Reading data from database.."
projectNumber = "32966"
docOutArray = Post.helpRequest("xdnjgjrdin.asp?Dok4=" & projectNumber)
If CPearson.IsArrayEmpty(docOutArray) Then
MsgBox "No document registered in database!"
End If
ProgressBar.Label_WhatsGoingOn.Caption = "Creating Docout.."
Set doc_ = NEwDocOut.createDocOutDocument(projectNumber)
numOfRows = UBound(docOutArray, 1)
For i = LBound(docOutArray, 1) To numOfRows
ProgressBar.Label_WhatsGoingOn.Caption = "Creating Row.."
sPercentage = (i / numOfRows) * 100
ProgressBar.progress (sPercentage)
My progressbar code:
Private Sub UserForm_Initialize()
Me.Text.Caption = "0% Completed"
End Sub
Public Sub progress(pctCompl As Single)
Me.Text.Caption = Format(pctCompl, "##") & "% Completed"
Me.Bar.Width = pctCompl * 2
Me.Repaint
DoEvents
End Sub
Any ideas why this happens?