I faced a problem: at the output I need to get xlsx for printing in landscape mode.
Conversion of gheet to xlsx is normal, however, when printed, it is in portrait mode. portrait=false has no effect. Someone faced with such?
function t(id) {
var url = "https://docs.google.com/feeds/download/spreadsheets/Export?key=" + id + "&portrait=false&&exportFormat=xlsx";
var response = UrlFetchApp.fetch(url, { headers: { Authorization: "Bearer " + ScriptApp.getOAuthToken() }, muteHttpExceptions: true });
return DriveApp.createFile(response.getBlob()).setName("t.xlsx").getId();
}