+ Reply to Thread
Results 1 to 7 of 7

Code to attach a sheet as an Outlook email attachment

  1. #1
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Code to attach a sheet as an Outlook email attachment

    Is there a way to attach an excel sheet and send it to email addresses in a workbook?

    Thanks

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Code to attach a sheet as an Outlook email attachment

    Hi,

    Have a look here: http://rondebruin.nl/sendmail.htm

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Code to attach a sheet as an Outlook email attachment

    Thanks, the code here worked but I am trying to edit it so that only certain names will be emailed. for example if toms and jims names are in a range then i want them to be emailed or if Bill,Jack, and Mark are in the range then I want them to be emailed. Is there a way to edit the code to achieve this. Thanks


    Please Login or Register  to view this content.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Code to attach a sheet as an Outlook email attachment

    Is it always a specific sheet you want to email and where would the list of people to send it to be kept?

    Dom

  5. #5
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Code to attach a sheet as an Outlook email attachment

    Here is the sample file. Basically, if there are any names in the yellow dropdown boxes, then I am trying to get an email to be sent to those names. Just the active "email" Sheet ould need to go out and the names and email addresses are in the Sheet3 tab.

    Thanks for the help
    Attached Files Attached Files

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Code to attach a sheet as an Outlook email attachment

    Try the attached.

    I changed the named range for your validation list from name to empnames as Name is a reserved word in Excel I think and could have caused problems.

    Dom
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    [SOLVED]Re: Code to attach a sheet as an Outlook email attachment

    Thanks so much. It generated perfectly!

+ 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