+ Reply to Thread
Results 1 to 3 of 3

Loop through files in folder, email file to listed recipient of file name = cell value

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Loop through files in folder, email file to listed recipient of file name = cell value

    Hi everyone,

    I have a number of files in a single folder. Each of these files must be emailed to unique recipients.

    In my VBA workbook, sheet DataSheet, column P has the file names (without extension), column Q is the To field, and column R is the CC field.

    What I'm trying to do is have a macro which will open file explorer, the user will identify the folder the files are located in, and then loop through each file in the folder. If the file name matches a value in column P, then outlook will send an email with the same file attached to the recipients listed in column Q and R. Below is what I have so far, but I keep getting an error on the Attach.add line.

    Please Login or Register  to view this content.
    Any ideas?

    Thanks!!!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,524

    Re: Loop through files in folder, email file to listed recipient of file name = cell value

    Try this:


    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Loop through files in folder, email file to listed recipient of file name = cell value

    Perfect. Thank you.

+ 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. Loop Through all files in folder only finding first file
    By Optional_karl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-02-2016, 07:28 AM
  2. VBA Look Through Folder and Open Files Not Listed in Master File
    By CGriffiths1214 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2015, 12:14 PM
  3. Replies: 3
    Last Post: 01-05-2014, 05:50 AM
  4. [SOLVED] Create hyperlink to file in another folder if listed in column A
    By MusicMan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2013, 04:43 AM
  5. Replies: 1
    Last Post: 11-01-2013, 03:22 PM
  6. Replies: 3
    Last Post: 05-06-2006, 11:50 AM
  7. Replies: 4
    Last Post: 02-11-2005, 03:06 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