SharePoint can't create Excel report in IE

Sevil Red 101 Reputation points
2021-02-05T08:03:06.83+00:00

Good day,

I have the script to create Excel report. It works fine for me in IE. But another users can't unload Excel report in IE. If I click F12, I see this error "it is impossible to create an object by the object programming server" after string

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

This information didn't help https://support.microsoft.com/en-us/office/enable-activex-controls-in-internet-explorer-04774c30-617d-4de4-a028-0fe03d68b955?ui=en-US&rs=en-US&ad=US

How can I create Excel report without ActiveXObject?
I use SharePoint 2016. My script
64396-scriptexample.txt

And I tried to use https://github.com/SheetJS/sheetjs/blob/master/README.md

My exportToExcel function became

function exportToExcel() {  
    
 var workbook = XLSX.utils.book_new();  
  
 var ws1 = XLSX.utils.table_to_sheet(document.getElementById('popular'));  
 XLSX.utils.book_append_sheet(workbook, ws1, "Sheet1");  
  
   /* bookType can be any supported output type */  
 var wopts = { bookType:'xlsx', bookSST:false, type:'array' };  
  
 var wbout = XLSX.write(workbook,wopts);  
  
 var fileName ="test.xlsx";  
  
 try {  
 var file = new File([wbout], fileName, { type: "application/octet-stream" });  
 saveAs(file);  
 } catch (err) {  
 var blob = new Blob([wbout], { type: "application/vnd.ms-excel" });  
 saveAs(blob, fileName);  
 }  
    
        }  

It works in FireFox and Google Chrome. But if I run it in IE, I see the word"downloading" only. How can I save excel file in IE 11?

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
906 questions
0 comments No comments
{count} votes