function GetExcelData(xlFile, sheet, row, colum) { //Open the excel file,like"C://myTestData.xls" var xlSheet = xlFile.Sheets(sheet); //Set the sheet name in which the testdata locates return xlSheet.Cells(row, colum); } function OperateExcelData(row, colum, file, sheet) { xlApp = new ActiveXObject("Excel.Application"); var xlFile = xlApp.Workbooks.Open(file); val = GetExcelData(xlFile, sheet, row, colum) //Do some operate about val... xlFile.Close(); xlApp.Quit(); xlFile,xlApp = undefined; }