Possible duplicate:
Google apps script to send Excel Excel version email
I searched everywhere for this, but I can't get it to work. I am sending an email with the application in a Google script application. The document is a google spreadsheet. It is currently being sent in pdf format, but I would like to send it as xls. When I run the code below, I get the request "Unsupported conversion". How can i send it as 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 }); }
source share