Possible Duplicate:
Google apps script to email google spreadsheet excel version
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?
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 });
}