title: Convert google spreadsheet to xls in google script
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12712137/google-apps-script-to-email-google-spreadsheet-excel-version">Google apps script to email google spreadsheet excel version</a>  </p>
  </blockquote>
  
  
  
  <p>I looked everywhere for this but cannot get it to work. I am sending an email with an attachment in google app script. The document is a google spreadsheet. It currently sends as a pdf, however, I would like it to send as a xls. When I run the below code, I get "Unsupported Conversion requested". How can I send it as an xls?</p>
  
  <pre><code>function practiceMail() {
  
  var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveRange();
  var file = DocsList.getFileById(docID);
  var attachment = file.getAs('application/vnd.ms-excel');
  var myFile = [file];
  
  MailApp.sendEmail(email, subject, body, {attachments:myFile, mimetype:application/vnd.ms-  excel });
  }
  </code></pre>