Forum Discussion
HKosova
Alumni
14 years agoHi Mike,
The answer is in your question: you need to use GetObject(, "TestComplete.TestCompleteApplication") instead of CreateObject("TestComplete.TestCompleteApplication").
The answer is in your question: you need to use GetObject(, "TestComplete.TestCompleteApplication") instead of CreateObject("TestComplete.TestCompleteApplication").
On Error Resume Next
Dim tcObj As TestCompleteApplication
' GetObject called without the first argument returns a reference to an instance of the application.
' If the application is not running yet, an error occurs.
Set tcObj = GetObject(, "TestComplete.TestCompleteApplication")
If Err.Number = 0 Then
MsgBox("TestComplete is running")
Else
MsgBox("TestComplete is not running")
End If
Err.Clear