+ Reply to Thread
Results 1 to 6 of 6

Sending emails to multiple recipients through VBA

  1. #1
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Sending emails to multiple recipients through VBA

    Hi,

    I realise there are already several threads on this, but I've read quite a few and I just can't seem to get it to work using any of the methods.

    This is my code:

    Please Login or Register  to view this content.
    I keep getting the following error "Array lower bound must be zero".

    Does anyone have any idea of how to fix this?

    Thanks!

    Mike

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sending emails to multiple recipients through VBA

    Hi,

    Which line is highlighted in yellow when you get the error message.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Sending emails to multiple recipients through VBA

    Hi man, thanks for the reply. The line that read "aEmail.to = strRecipients"

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sending emails to multiple recipients through VBA

    Hi

    The variable strRecipients is returning a range value. In order to include a list of recipients in an Outlook email the recipients needs to be a text string of names separated by a ";" character.

    The way I generally approach this is to use a loop to build the text string. e.g.

    Dim stEmailNames As String

    Please Login or Register  to view this content.
    Then your Outlook To line is
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Sending emails to multiple recipients through VBA

    Ah, awesome, that worked, thanks so much!

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sending emails to multiple recipients through VBA

    OK, glad to have helped.

    Of course if the email names never change I'd be inclined to create the text string in an Excel cell and just read that cell in the .To instruction thus avoiding the loop altogether. I only generally use the looping approach where I have a selection criteria alongside the email table of names where only a subset of the names needs to be included. In that event I build the selection column into the loop and only add the name of it is 'ticked'.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sending two different emails to two different recipients with single button using vba
    By ahowe in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-23-2013, 08:28 PM
  2. Replies: 0
    Last Post: 09-22-2012, 10:06 AM
  3. Delay sending to multiple recipients from one message
    By Reema in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 02-27-2009, 02:37 AM
  4. Sending Emails FROM Multiple Addresses
    By jamesryan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2009, 07:29 AM
  5. [SOLVED] Sending Attachments to multiple recipients
    By Prabha in forum Excel General
    Replies: 3
    Last Post: 01-24-2005, 12:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1