+ Reply to Thread
Results 1 to 2 of 2

Run Time Error : Mail different file to each person in Range

  1. #1
    Registered User
    Join Date
    03-21-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    23

    Run Time Error : Mail different file to each person in Range

    Experts,

    I got VBA code for Mail a different file(s) to each person in a range from
    'http://www.rondebruin.nl/win/winmail/Outlook/tips.htm

    But getting Run time error 1004: No cells were found.

    Please Login or Register  to view this content.
    I change the sheet name and error throws in line For Each FileCell In rng.SpecialCells(xlCellTypeConstants)

    Please help

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Run Time Error : Mail different file to each person in Range

    Hi Mitiraj,

    You need a little bit of defensive programming. Your code works fine if there are valid email addresses, but will generate run time errors if there is nothing in a range. This is normal Excel behaviour. Try the following code wihich worked fine for me when I tested with one email address and one attachment.

    Please Login or Register  to view this content.
    Lewis

+ 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. Mail a different file(s) to each person in a range
    By lioneltanyk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2013, 01:38 AM
  2. [SOLVED] Mail a different files to each person in a range
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. [SOLVED] Mail a different files to each person in a range
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 05:05 PM
  4. Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  5. Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  6. [SOLVED] Mail a different files to each person in a range
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 09:05 AM
  7. Mail a different files to each person in a range
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-06-2005, 05:05 AM
  8. [SOLVED] Mail a different files to each person in a range
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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