Convert google table to xls in google script

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 }); } 
+4
source share
2 answers

Please see this question for an explanation. In short, the answer is no. You can not do it. However, there is an open problem that you can run to request this function.

+1
source

Source: https://habr.com/ru/post/1439323/


All Articles