日期:2014-05-16 浏览次数:20345 次
var excel=new ActiveXObject("Excel.Application")
var wb = excel.Workbooks.Open("C:/xxx/a.xls");
var sh = wb.ActiveSheet;
alert( sh.Cells(1,1) ) //第一A1
alert( sh.Cells(2,1) ) //第一B1
wb.close();
excel.Quit();
excel=null;
var excel=new ActiveXObject("Excel.Application")
var wb = excel.Workbooks.Open("C:/Users/fzfei/Desktop/temp/a.xls");
var sh = wb.ActiveSheet;
var i=1;
while( sh.Cells(1,i).value && sh.Cells(2,i).value ){
alert( sh.Cells(1,i) ) //第一A1
alert( sh.Cells(2,i++) ) //第一B1
}
wb.close();
excel.Quit();
excel=null;