how to iterate through worksheets while using get ActiveXObject("Excel.Aplication")
I am using Javascript for my project. I am picking up test data from excel sheet via getActiveXObject. Earler I was just picking data from one sheet but now I am required to pick data correspoding to each testcase from different worksheets.I have written code to get row count , when my Workbook had just one worksheet ,it worked fine. I am not able to get worksheet object and workshet count . Below is my code:
function get_valid_row_count (ExcelPath)
{
var objExcel = getActiveXObject("Excel.Application");
//objExcel.Visible = true;
var aobjWorkbook = objExcel.Workbooks.Open(ExcelPath);
(what method sould I use here to get refernce to worksheets so that I can iterate through them and go to each worksheet by using their name)
var iUsedRowCount = aobjWorkbook.ActiveSheet.UsedRange.Rows.Count;
var ValidRowCnt = (iUsedRowCount-1);
return ValidRowCnt;
}
How can I get worksheet objcet so that I can pass it in place of 'Activesheet'. Also I am not able to check what methods are avilable for the workbook object..whatever I try I get error that this is not a function.