How to …


How to use .sendmail to multiple email addresses

I am using .SendMail in an Excel VBA Macro to send a workbook to an email address.  It works fine, but I needed to send to multiple recipients.

Here was the syntax I started with:

ThisWorkbook.SendMail "", "Text for the Subject Line"

When I tried to add multiple addresses, I tried commas, I tried semi-colons, and I tried an Array command, none of which worked.

Finally I realized that I was using messy syntax, and cleaned it up and got it to work this way:

ThisWorkbook.SendMail Recipients:=Array("","") Subject:="Text for Subject Line"

That worked!

That allowed me to mail (as an attachment) the workbook to multiple addresses without throwing any errors.

Linda - - The "How" Blog

[Slashdot] [Digg] [Reddit] [] [Facebook] [Technorati] [Google] [StumbleUpon]