25. VBA Tips - Email Workbook

Nick's picture


There's an easy way to email a workbook with a single line of code:

  • Use "Activeworkook.SendMail"

Here's the code:

email-workbook

Here's the email it produces:

email-workbook

 

Explanation

  1. SendMail accepts 3 parameters... Recipients, Subject, and whether you want a read receipt.
  2. Note: You cannot add a body to the mail... this is a quick and limited way of emailing the workbook.

Download sheet to practise how to Email Workbook in Excel

Training Video on how to Email Workbook in Excel:

AttachmentSize
email-workbook.xls51.5 KB
Nick's picture

Emailing many Recipients

To email multiple contacts, Recipients needs to be an array.

Dim myRecipients(1 to 2)

myRecipients(1) = "a@b.com"

myRecipients(2) = "a@c.com"

 

Nick