//
// Close all excel instances
function closeExcelInstances()
{
var childcounts = Sys.ChildCount;
for(var count=0; count<childcounts; count++)
{
if(Sys.WaitProcess("Excel", 0).Exists == true)
{
var processcount = count + 1;
Sys.Process("Excel").Terminate();
Log.Message("Excel processs count: " +processcount+ " successfully closed");
Sys.Refresh();
childcounts = Sys.ChildCount;
count=0;
}
}
return;
}
=============
var ExcelFilePath = ""+Sys.OSInfo.TempDirectory+""+excelfile+"";
var SheetName = "Sheet1";
// Open the above Excel file through Sys.OleObject
var MsExcel = Sys.OleObject("Excel.Application", "");
MsExcel.Workbooks.Open(ExcelFilePath);
var Sheet = MsExcel.Sheets.Item(SheetName);
.
.
// Close Sys.OleObject for Excel application
MsExcel.Quit();
Delay(1000);
// Select 'No/Don't Save' button
selectMicrosoftExcelInfoDontSaveBtn();