25. VBA Tips - Email Workbook
There's an easy way to email a workbook with a single line of code:
- Use "Activeworkook.SendMail"
Here's the code:
Here's the email it produces:
Explanation
- SendMail accepts 3 parameters... Recipients, Subject, and whether you want a read receipt.
- 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:
Attachment | Size |
---|---|
email-workbook.xls | 51.5 KB |
»
- Nick's blog
- Login or register to post comments
- 16428 reads
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