+ Reply to Thread
Results 1 to 5 of 5

Need help with macro to send selection from Excel to email, but without sending the email

  1. #1
    Registered User
    Join Date
    09-08-2015
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    10

    Need help with macro to send selection from Excel to email, but without sending the email

    Hi,
    Using the below Ron Debruin code, I'm able to copy and paste an excel selection into an outlook email with the click of a button, but the email also sends to the designated email address, which I do not want to happen. I simply want the macro to copy and paste the selection into a draft outlook email, that may be further modified by a user within Outlook, prior to sending. Any help that can be provided would be much appreciated. Thanks!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need help with macro to send selection from Excel to email, but without sending the em

    Please Login or Register  to view this content.
    In the code, it says use .Display instead of .Send
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need help with macro to send selection from Excel to email, but without sending the em

    With OutMail
    .To = ""
    .CC = ""
    .BCC = ""
    .Subject = "This is the Subject line"
    .HTMLBody = RangetoHTML(rng)
    ' In place of the following statement, you can use ".Display" to
    ' display the e-mail message.
    ' .Send ' <---Comment out this line
    .Display '<--- Add this line
    End With
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    09-08-2015
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Need help with macro to send selection from Excel to email, but without sending the em

    Thanks! That was a pretty poor oversight on my part.

    One more question. I am also using code where my excel selection will be attached to an to an email in a new workbook. My question is, is there code that can be incorporated to lock all cells and then password protect the sheet that is being created and attached? Thanks again!

    Here is the code that I am using:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need help with macro to send selection from Excel to email, but without sending the em

    You could record a macro where you do the steps to lock all the cells and password protect the sheet. Then copy those recorded steps to your email macro. Place the new code in the email macro after you've pasted the values but before you save the workbook.

+ 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. Replies: 0
    Last Post: 11-24-2015, 03:29 AM
  2. olMail - Email Attachment Variable. Sending Email through Excel
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2014, 07:55 AM
  3. olMail - Email Attachment Variable. Sending Email through Excel
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2014, 07:41 AM
  4. Macro sending email from different email address.
    By learningslowly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2014, 03:24 PM
  5. automation/macro for sending email to multiple email address
    By saurabhlotankar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2013, 12:13 PM
  6. Excel Email Macro VBA - How to send an email once all required fields have been fille
    By wallacm2009 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2012, 10:51 AM
  7. Replies: 6
    Last Post: 12-02-2011, 02:14 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