Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9831

How to use Google Script to email a pdf of just one sheet (tab) within a spreadsheet/

$
0
0

I have located some similar posts but none of the solutions seemed to work.

I have a function that sends me an email PDF of a spreadsheet. I just want the email attachment to send the first sheet (tab) in the spreadsheet which is just titled "Report" I don't want it to send the other tabs. Can someone help me modify the script below to just send the first tab?

The script I have so far is:

function publish() { var message = { to: "Redacted email address", subject: "Report",    body: "Attached is the report",    name: "Report",    attachments: [SpreadsheetApp.getActiveSpreadsheet().getAs(MimeType.PDF).setName("Report")]  }  MailApp.sendEmail(message);}

Viewing all articles
Browse latest Browse all 9831

Latest Images

Trending Articles



Latest Images