Excel.ActiveWorkBook.WorkSheets is not a function
I am working with scripts that read in an excel file for input data and verification.
I have had no issue in the past but in one of my read functions I am getting a jscript runtime error of
TypeError
excel.ActiveWorkBook.WorkSheets is not a function Error location:
I am unsure how this error is occurring as I have used the ActiveWorkBook.WorkSheets call in other places.
This is the code the error is being thrown on.
function ReadRow(rownum, columnstart, filename, sheetname, columnend) {
var filepath = "C:/Repositories/Git/Repos/Automation/Automation/ExcelSheets/" + filename;
var excel = Sys.OleObject("Excel.Application");
excel.Workbooks.Open(filepath);
var xlsheet = excel.ActiveWorkBook.WorkSheets(sheetname);
//Read some data
return rowdata;
}