Forum Discussion
AlexanderM
13 years agoStaff
Hello Vinod,
This problem can appear when the Excel process with index 1 is closed and does not exist, but TestComplete has not refreshed its internal objects tree yet. In this case, the code Sys.waitProcess("EXCEL", 10). Exists will return false while not all of Excel processes were closed. To avoid this situation, you can search for an Excel process irrespectively to its index using the Sys.FindChild method.
Dim p, isClosed
Set p = Sys.FindChild("ProcessName", "EXCEL")
While p.Exists
p.Close()
'Wait until the process is closed.
isClosed = p.WaitProperty("Exists", False)
'If closing failed, terminate the process.
If isClosed = False Then
p.Terminate()
End If
Set p = Sys.FindChild("ProcessName", "EXCEL")
Wend
Related Content
Recent Discussions
- 2 days agoMW_Didata