title: Send active sheet as PDF to email listed in cell
body: <p>I'm trying to use the script below to send the first sheets in a Google Sheets document to an email as PDF. The email to send to, is listed in cell A1.</p>
  <p>However, this script send the entire spreadsheet as an PDF and not just the first sheet. I have been trying to use some of the other scripts from Stack Overflow, but this is the only one that actually sends an email.</p>
  <pre><code>        /* Email Google Spreadsheet as PDF */
  function emailGoogleSpreadsheetAsPDF() {
    
    // Send the PDF of the spreadsheet to this email address
    var email = &quot;amit@labnol.org&quot;; 
    
    // Get the currently active spreadsheet URL (link)
    var ss = SpreadsheetApp.getActiveSpreadsheet();
  
    // Subject of email message
    var subject = &quot;PDF generated from spreadsheet &quot; + ss.getName(); 
  
    // Email Body can  be HTML too 
    var body = &quot;Install the &lt;a href='http://www.labnol.org/email-sheet'&gt;Email Spreadsheet add-on&lt;/a&gt; for one-click conversion.&quot;;
    
    var blob = DriveApp.getFileById(ss.getId()).getAs(&quot;application/pdf&quot;);
    
    blob.setName(ss.getName() + &quot;.pdf&quot;);
    
    // If allowed to send emails, send the email with the PDF attachment
    if (MailApp.getRemainingDailyQuota() &gt; 0) 
      GmailApp.sendEmail(email, subject, body, {
        htmlBody: body,
        attachments:[blob]     
      });  
  }
  </code></pre>