+ Reply to Thread
Results 1 to 3 of 3

Macro to email an attachment sending two copies

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Macro to email an attachment sending two copies

    Hi, I've borrowed the following code from http://msdn.microsoft.com/en-us/libr...ffice.11).aspx, which is apparently meant to send an email to the specified address.
    When I run it, however, it instead sends two copies, or, if I choose .Display instead of .Send, opens up two copies of the email with the attachment.

    I'm sure the fix is really simple, but was wondering if anyone could shed any light on my problem?

    Thanks in advance!

    Please Login or Register  to view this content.
    I'm calling this macro within another, which when commenting out this line, runs with no hitches. When I run the code on its own (without calling it from the other macro), it only sends the one copy. However, as soon as I run it within the other macro, I go back to getting two? I have no idea what's going on!

    To call this code, I'm simply using
    Please Login or Register  to view this content.
    Last edited by Authentik8; 07-05-2012 at 07:33 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to email an attachment sending two copies

    Hi,

    Seems to work OK for me and only produces one email.

    Are you sure you're not calling it from a loop which is running twice?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Macro to email an attachment sending two copies

    I'll post the parent macro along with the relevant spreadsheets, maybe then you'll get the same error.

    I don't think I'm somehow calling the sub twice, but you'll see.
    The routine is to open up the sorting file, which will then prompt you to select a trade file to process (also attached), then prompt for a save location. Maybe it'll do it for you, if not I don't know what I'm doing wrong! Attachment 166154Attachment 166155

+ 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