I was able to create the XLS file using JavaScript using Active X controls.
For IE I did the following :
var objExcel = new ActiveXObject("Excel.Application");
objExcel.visible = false;
var objWorkbook = objExcel.Workbooks.Add;
var objWorksheet = objWorkbook.Worksheets(1);
objWorksheet.Paste;
objExcel.visible = true;
But to use ActiveX controls I need to go to Internet Option -> Security ->Custom Level ->Enable Initialize and script ActiveX controls not marked as safe for scripting . After enabling this only I am able to create the XLS file.
Is there any other way to create the XLS file in IE-11 apart from active X I tried to use the following
var vDiv = document.getElementById('dvData');
vDiv.innerHTML = vTable;
var url='data:application/vnd.ms-excel,' + encodeURIComponent($('#dvData').html()) ;
but its not working in IE-11. I need to use pure javascript.
Thanks in advance