txt不好?
水一发,读取表格内容- /*&cls
- @echo off
- ::设置表格路径
- set "xlsfile=D:\改名.xls"
- cscript -nologo -e:jscript "%~f0" "%xlsfile%"
- pause&exit
- */
-
- var objExcel = new ActiveXObject('Excel.Application');
- var objBook = objExcel.Workbooks.open(WScript.Arguments(0));
- objBook.worksheets(1).activate; //设置Sheet1为活动工作表
- var objSheet = objBook.activeSheet;
- var cnt = objSheet.usedrange.rows.count;
- for(var i = 2; i<=cnt; i++) { //从第2行开始
- var A= objSheet.Cells(i, 1).value; //A列
- var B= objSheet.Cells(i, 2).value; //B列
- WSH.echo(A+' --> '+B);
- }
- objBook.Close();
- objExcel.Quit();
复制代码
|