Ask a Question

JavaScript runtime error. ReferenceError: Excel is not defined

SOLVED
abishekhari007
Contributor

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

1 REPLY 1
hkim5
Staff

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

Best,
Justin Kim
cancel
Showing results for 
Search instead for 
Did you mean: