vinodtc
13 years agoContributor
How to close Excel instances by using code
Hi,
I have written following code in OnStartTest Event. When there are 2 excel instances are there (Screen shot attached), it is unable to close those instances. Excel instance are showing in Object browser as Process("EXCEL",2) and Process("EXCEL"). How do we close these instances?
Sys.Process("EXCEL").Close
I have written following code in OnStartTest Event. When there are 2 excel instances are there (Screen shot attached), it is unable to close those instances. Excel instance are showing in Object browser as Process("EXCEL",2) and Process("EXCEL"). How do we close these instances?
Sub GeneralEvents_OnStartTest(Sender)
while Sys.waitProcess("EXCEL", 10).Exists
Sys.Process("EXCEL").Close
wend
while Sys.waitProcess("iexplore",10).Exists
Sys.Process("iexplore").Close
wend 
End Sub
Regards,
Vinod