I have a HTML table, I am exporting its content to Excel,This is how I am doing
function CreateExcelSheet() {
var x = document.getElementById("testTable").rows;
var xls = new ActiveXObject("Excel.Application");
xls.visible = true;
xls.Workbooks.Add
for (i = 0; i < x.length; i++) {
var y = x[i].cells;
for (j = 0; j < y.length; j++) {
xls.Cells(i + 1, j + 1).Value = y[j].innerText;
}
}
xls.Visible = true;
xls.UserControl = true;
return xls;
}
its generating Excel properly, but after generating its opening it, I have to download it after generating. I have no clue how to call window.location.href in this scenario. I have to do this in IE only.