1

I need to download a table into Excel with IE browser. I have a solution with this codes. But it runs really slow, nearly half a minute to get the Excel done. Is there any other way to make this?

var curTbl = document.getElementById(tableid);
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;
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Jim Wang
  • 11
  • 1

0 Answers0