I am facing one issue; on the button click event see the code in red color, I have a timer and I am invoking qtp and also running a qtp test. What I am trying to do is till the system loads the qtp, I want to run the progress bar. The code is correct but the progress bar does not run in parallel with the qtp invoking code. If I comment the invoking part and run then the progress bar shows progress. Please help
Private Sub Ok_Click()
If update.Value = True Then
WinExec "Explorer.exe " & "C:\ ", 10
ElseIf copy.Value = True Then
WinExec "Explorer.exe " & "C:\ ", 10
ElseIf run.Value = True Then
Main.Timer1.Enabled = True
Set obj = CreateObject("QuickTest.Application") 'Creates an instance of the QTP
Sleep 100
obj.Launch
obj.Visible = True
obj.WindowState = "Maximized" 'Maximizes the application window of the QTP
obj.Open "C:\<path>" 'Opens the script from in an editable mode
obj.Test.run 'Runs the script
obj.Quit 'Quits the QTP application
End If
End Sub
Private Sub Timer1_Timer()
If Timer1.Enabled = True Then
ProgressBar1.Value = ProgressBar1.Value + 2
End If
If ProgressBar1.Value = 100 Then
Main.Timer1.Enabled = False
Main.ProgressBar1.Value = 0
End If
End Sub