I am looking for a convert current google sheet into PDF and send mail ActiveSheet
.
: This code looping all sheet into pdf and emailing me I want mail only active tab.
//this code working fine but looping all sheet
function sendReport() {
var message = {
to: "maneeshsinghal9810@gmail.com",
subject: "Monthly sales report",
body: "Hi team,\n\nPlease find the monthly report attached.\n\nThank you,\nBob",
name: "Bob",
setName: "New",
attachments: [SpreadsheetApp.getActiveSpreadsheet().getAs(MimeType.PDF).setName("New Report")]
}
MailApp.sendEmail(message);
}
// this method is not working
// var ss = SpreadsheetApp.getActiveSpreadsheet();
// var singleSheet = ss.getActiveSheet()