导出EXCEL 直接copy界面元素导出 (要提前安装好微软office那一套)

wms_ow_sku_inout_dw.expData = function() {

var curTbl = $("wms_ow_sku_inout_dataTable");

var oXL = new ActiveXObject("Excel.Application");

var oWB = oXL.Workbooks.Add();

var oSheet = oWB.ActiveSheet;

var sel = document.body.createTextRange();

sel.moveToElementText(curTbl);

sel.select();

sel.execCommand("Copy");

oSheet.Paste();

oXL.Visible = true;

}

你可能感兴趣的:(导出EXCEL 直接copy界面元素导出 (要提前安装好微软office那一套))