+ Reply to Thread
Results 1 to 5 of 5

Excel to send email via Outlook (attachment)

  1. #1
    Forum Contributor
    Join Date
    04-06-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    103

    Excel to send email via Outlook (attachment)

    Hi there

    I have a spreadsheet which lists accounts in Column D. In column J I have a simply formula which checks if some figures are correct and places the word MATCH in the coresponding cell if so. In column L I have a list of email addresses which relate to each account number. Column M is the path of the file I would like to attach for each account.

    I have the following code which creates and sends emails with attachments, however it always sends the same attachment as it looks at a set path. Is there anyway the code can be amended to look at the file path in column M and attached the file?

    Please Login or Register  to view this content.
    Thanks

  2. #2
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Excel to send email via Outlook (attachment)

    Yes it can.

    add

    Please Login or Register  to view this content.
    to the declarations at the top and then

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-06-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    103

    Re: Excel to send email via Outlook (attachment)

    Hey there,

    Thanks, that's great!

  4. #4
    Forum Contributor
    Join Date
    04-06-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    103

    Re: Excel to send email via Outlook (attachment)

    Hi again,

    Another quick question - do you know how I could count how many emails have been sent out?

    Thanks again

  5. #5
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Excel to send email via Outlook (attachment)

    Fairly easy to do.

    Add a variable to your declarations as an integer and somewhere in the loop you have to send out emails put a variable = variable + 1 so, obviously, it adds one to the total every time the send an email loop...er....loops. Then at the very end of your macro you could either output the variable to a cell or simply msgbox it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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