Forum Discussion
Ryan_Moran
12 years agoValued Contributor
There probably is a way to do exactly that, but usually if you encounter a portion of your script where an object may or may not exist you'll just want to have a check for said object using a variety of Wait methods and Exists property.
Ex:
function closeexcel(){
if (Sys.WaitProcess('EXCEL',0).Exists){ //checks if process exists and waits 0 seconds
Sys.Process('EXCEL').Terminate();
}
}
Ex:
function closeexcel(){
if (Sys.WaitProcess('EXCEL',0).Exists){ //checks if process exists and waits 0 seconds
Sys.Process('EXCEL').Terminate();
}
}