Forum Discussion

abishekhari007's avatar
abishekhari007
Contributor
5 years ago

JavaScript runtime error. ReferenceError: Excel is not defined

I tried to write data in an excel cell using the below code

function abc()
{
  var excelFile = Excel.Open("C:\\temp\\DataStorageExcel.xlsx");
  var excelSheet = excelFile.SheetByTitle("Sheet");
  var valueC = excelSheet.CellByName("C3").Value;
  excelSheet.Cell("C", 8).Value = valueC;
  excelFile.Save();
}

When i run the code i get an error as "JavaScript runtime error. Reference Error: Excel is not defined"

 

Can anyone help

  • if you are on TestComplete version 14.60 please consider filing for a support ticket, since it sounds like the Excel object is not being recognized. otherwise, the syntax there looks ok, seeing as it is the same as our documentation

  • if you are on TestComplete version 14.60 please consider filing for a support ticket, since it sounds like the Excel object is not being recognized. otherwise, the syntax there looks ok, seeing as it is the same as our documentation