Not able to open excel from test complete
getting the below error
sorry we couldn't find C:\QA\PATCAT\PATCAT_suite\PATCAT\Results\CATRegressionCompareTestResults.xlsx. Is it possible it was moved, renamed or deleted?
I can see the excel in the same path.
This is my code
resultToExcel.rowNo= 2; //static variable
function resultToExcel(Apptn,graphname,count)
{
var rowNo;
var fileName=Project.ConfigPath+"\Result\\CATRegressionCompareTestResults.xlsx";
var excel = Sys.OleObject("Excel.Application");
var myWorkbook = excel.Workbooks.Open(fileName); //// this line is giving the error
var mySheet = myWorkBook.Sheets.Item("Sheet1");
excel.Cells.Item(rowNo,2).Value=graphname;
if(Apptn="PAT")
{
excel.Cells.Item(rowNo,3).Value=count;
}
else if(Apptn="CAT")
{
excel.Cells.Item(rowNo,4).Value=count;
}
myWorkBook.Save();
excel.Quit();
}
Please let me know if i am doing anything wrong
used Project variable it is working fine Thanks