1. Option explicit means you have to declare variable before you using.
2. You can use the below code to close QTP
3. find the answer in the following link
http://relevantcodes.com/qtp-closing-mul...r-windows/
2. You can use the below code to close QTP
Code:
Private Function CloseQTP
Set objWMIService = GetObject(“winmgmts:\\.\root\CIMV2″)
Set colProcess = objWMIService.ExecQuery (“Select * from Win32_Process Where Name = ‘QTPro.exe’”)
For Each objProcess in colProcess
objProcess.Terminate()
Next
Set objWMIService = Nothing
Set colProcess = Nothing
End Function
3. find the answer in the following link
http://relevantcodes.com/qtp-closing-mul...r-windows/