JScript
function ExcelTest() { var p = Sys.Process("EXCEL"); var coolWindow = p.Window("XLMAIN").Window("XLDESK").Window("EXCEL7"); var objExcel = coolWindow.NativeObject.Application; // Now we can close Excel having that reference objExcel.Quit(); }
VBScript
Sub ExcelTest Dim p, coolWindow, objExcel Set p = Sys.Process("EXCEL") Set coolWindow = p.Window("XLMAIN").Window("XLDESK").Window("EXCEL7") Set objExcel = coolWindow.NativeObject.Application ' Now we can close Excel having that reference objExcel.Quit End Sub
Python
def ExcelTest(): p = Sys.Process("EXCEL") coolWindow = p.Window("XLMAIN").Window("XLDESK").Window("EXCEL7") objExcel = coolWindow.NativeObject.Application # Now we can close Excel having that reference objExcel.Quit