+ Reply to Thread
Results 1 to 3 of 3

Thread: Email worksheet (not entire workbook) to various recipients

  1. #1
    Valued Forum Contributor
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2007
    Posts
    996

    Smile Email worksheet (not entire workbook) to various recipients

    I downloaded a macro to email a specific worksheet within a workbook, but you have to hard code the recipient. The macro works perfectly, its only drawback is the hard coded email addy. I use MS outlook, and I assume that the macro opens Outlook invisibly when it sends. Can anyone advise me on how to improve its functionality to allow the user to add their own "to" recipients? Ideally, I would like Outlook to open to allow the user to enter their own adresses, and then "send" as normal.

    I have seen some of the "miracles" the gurus here have produced in excel, so Im sure this will be a breeze. Thanks in advance.

    Below is the part of the macro that does the "send"

    With Destwb
       .SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
          On Error Resume Next
          For I = 1 To 3
             .SendMail "myemailaddy@somename.com", _
                "test send"
                If Err.Number = 0 Then Exit For
          Next I
          On Error GoTo 0
       .Close SaveChanges:=False
    End With
    Last edited by FDibbins; 01-01-2012 at 07:36 PM. Reason: CODE tags per Rules please...

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Email worksheet (not entire workbook) to various recipients

    Change "myemailaddy@somename.com" to "" and the user will be prompted via OL dialog.

    Technically you are emailing a workbook in it's entirety, however, that workbook contains only the desired sheet(s) from the original source file

  3. #3
    Valued Forum Contributor
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2007
    Posts
    996

    Re: Email worksheet (not entire workbook) to various recipients

    HA awesome, works just the way I need it to

    You guys are fantasitc, thanks

+ 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.2.0