title: Creating a xls file using javascript, downloading an unsupported format
body: <p>I am trying to create a <strong>.xls file</strong> using JavaScript. When I try to open the file it shows a warning, also when I try to edit and save it. It wants me to create a new file out of it or else it stores all of its necessary data in a separate folder, or else I have to convert it to compatible mode.</p>
  <pre><code>        var tableBody  = '&lt;html xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;&gt;&lt;head&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=windows-1252&quot;&gt;';
          tableBody +='&lt;!--[if gte mso 9]&gt;&lt;xml&gt;&lt;x:ExcelWorkbook&gt;&lt;x:ExcelWorksheets&gt;&lt;x:ExcelWorksheet&gt;&lt;x:Name&gt; Quotation &lt;/x:Name&gt;&lt;x:WorksheetOptions&gt;&lt;x:Panes&gt;&lt;/x:Panes&gt;&lt;y:Panes&gt;&lt;/y:Panes&gt;&lt;/x:WorksheetOptions&gt;';
          tableBody +='&lt;/x:ExcelWorksheet&gt;';
          tableBody +='&lt;/x:ExcelWorksheets&gt;&lt;/x:ExcelWorkbook&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;/head&gt;&lt;body&gt;';
          tableBody +=quoteBody.substringBetween('&lt;html&gt;','&lt;/html&gt;' );
          tableBody +='&lt;/body&gt;&lt;/html&gt;';
  
  
  
          let downloadLink = document.createElement('a');
          downloadLink.download = quoteFileName+'.xls';
          downloadLink.href = 'data:application/vnd.ms-excel;base64,'+response.getReturnValue();
          downloadLink.click();
  </code></pre>
  <p><a href="https://i.stack.imgur.com/H2gTo.png" rel="nofollow noreferrer">When I try to open the downloaded excel file. I click yes to open it.</a></p>
  <p><a href="https://i.stack.imgur.com/xK8RA.png" rel="nofollow noreferrer">When I try to save the downloaded excel file.</a></p>
  <p>What am I going wrong? Is it with the excel version or something else.</p>
  <p>Thanks in advance.</p>