I have a SharePoint 2013 list. Using jquery I have exported the data into a table and added customized code for export to excel to that particular table data. But am getting an error
Automation server can't create object** at the line * excel = new ActiveXObject('Excel.Application');
while I try to export. PFB code to export:
function CreateExcelSheet() {
var i, j, str,str1,k,l,m,n,
myTable1 = document.getElementById('project'),
rowCount1 = myTable1.rows.length,
excel = new ActiveXObject('Excel.Application');// Activates Excel
excel.Workbooks.Add(); // Opens a new Workbook
excel.Application.Visible = true; // Shows Excel on the screen
for (i = 0; i < rowCount1; i++) {
for (j = 0; j < myTable1.rows[i].cells.length; j++)
//for (j = 0; j < 11; j++)
{
str1 = myTable1.rows[i].cells[j].innerText;
excel.ActiveSheet.Cells(i + 1, j + 1).Value = str1; // Writes to the sheet
k=i;
l=j;
}
}
return;
}