var filePath1 = document.getElementById('upfile');
//创建操作EXCEL应用程序的实例
var oXL = new ActiveXObject("Excel.application");
//打开指定路径的excel文件
var oWB = oXL.Workbooks.open(filePath1.value);
//操作第一个sheet(从一开始,而非零)
oWB.worksheets(1).select();
var oSheet = oWB.ActiveSheet;
//使用的行数
var rows = oSheet .usedrange.rows.count;
var trHtml="";
// try {
for (var i = 2; i <= rows; i++) {
var cll1 = oSheet.Cells(i, 1).value;
var cll2 = oSheet.Cells(i, 2).value;
var cll3 = oSheet.Cells(i, 3).value;
var cll4 = oSheet.Cells(i, 4).value;
var cll5 = oSheet.Cells(i, 5).value;
var cll6 = oSheet.Cells(i, 6).value;
var cll7 = oSheet.Cells(i, 7).value;
// alert(cll1+"-"+cll2+"-"+cll3+"-"+cll4+"-"+cll5+"-"+cll6+"-"+cll7);
var currentRow = wms_ow_container_dw_info.insertRow();
wms_ow_container_dw_info.setElement(currentRow, "customerNo", cll1);
wms_ow_container_dw_info.setElement(currentRow, "blNo", cll2);
wms_ow_container_dw_info.setElement(currentRow, "qty", cll3);
wms_ow_container_dw_info.setElement(currentRow, "weight", cll4);
wms_ow_container_dw_info.setElement(currentRow, "volume", cll5);
wms_ow_container_dw_info.setElement(currentRow, "palletQty", cll6);
wms_ow_container_dw_info.setElement(currentRow, "remarks", cll7);
}
// } catch(e) {
// alert(e);
// }
document.getElementById("txtArea").value = tempStr;
//退出操作excel的实例对象
oXL.Application.Quit();
//手动调用垃圾收集器
CollectGarbage();