+ Reply to Thread
Results 1 to 13 of 13

Email With Attachments - Failing

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Email With Attachments - Failing

    .
    .
    The following code is ever present on numerous websites. In general it works, but not well. Oftentimes not all of the email addresses are sent and/or the attachments are either duplicated or not sent at all.
    I don't understand alot about linking to Outlook and lack sufficient expertise to troubleshoot.

    I suspect the examples posted on websites provide just enough to function but lack everything needed to do so completely (of course I could be wrong again )

    So ... what's missing or what is wrong with my computer ? (I added the time delay to give the code an opportunity to 'work' more efficiently - on my computer it made a slight difference of improvement)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Logit; 12-20-2016 at 10:29 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Emai With Attachments - Failing

    I had issues for a long while.

    Then I realised that Outlook had a max size of attachment setting.

    I increased that and my problems disapeared.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Re: Emai With Attachments - Failing

    Look at the settings. Well within the limits.

    Thank you for the suggestion.

    Merry Christmas !

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,354

    Re: Email With Attachments - Failing

    How about this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Re: Email With Attachments - Failing

    I did some testing with increasing the delay time between email sends.

    The X's indicate how many times that specific email message was received and the numbers adjacent to the X's indicate the order received in mailbox.

    Interesting that 5 seconds seems to cover all the emails (and sending each one twice by list) yet some of the emails were sent three times although the code doesn't indicate such.

    .Row 3, 5 sec should have three x's to indicate three separate emails coinciding with receive sequence: 14 , 17 , 19


    .
    .Email.jpg

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Re: Email With Attachments - Failing

    bakerman2

    Had to add some DIM statements .... not working. Not sending any emails at all - nothing received. This is what I have so far.

    It's late, will check this thread in morning. Thank you.

    Please Login or Register  to view this content.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,354

    Re: Email With Attachments - Failing

    Had to add some DIM statements
    That's what you get when using Option Explicit. (I never do)

    Then, what's the rw doing in the code. You initialize it but then do nothing to give it a value.
    So in short, loose the Option Explicit and try my code as is.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Re: Email With Attachments - Failing

    Removing Option Explicit the code fails on:

    Please Login or Register  to view this content.
    With error code "Item Moved or Deleted"

    Nothing changed in the attachment listings or their location.

    It manages to send two emails but no more. One of the emails has an attachment that isn't listed in Col B. Unusual ...

    ================================================================================================

    I believe what is happening with my code pertains to the speed / ability of my internet connection to 'accept' each email as it is being sent. It may also
    involve my modem or some other component of connection to the internet / ISP. With the built in delay my system has the opportunity to actually send an
    email before presented with another one that needs sending.

    Is that reasonable or am I grasping at straws ?
    Last edited by Logit; 12-21-2016 at 03:31 PM.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,354

    Re: Email With Attachments - Failing

    You could also delay execution a bit more by adding a check if attachment exists to each loop.(which isn't that a bad idea after all)
    If your connection speed is really the cause then delaying each loop might in fact be the only option.

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Re: Email With Attachments - Failing

    Thank you for the reply.

    Please provide example code for checking if the attachment exists. Hopefully, that would assist with the code not selecting something close to the attachment name if the attachments are located in a directory with
    a number of 'non-listed' files.

    Does that make sense or should all of the attachment files always be located in a separate folder by themselves ?

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,354

    Re: Email With Attachments - Failing

    Check out the Dir function to check if a file exists or not.
    Normally it shouldn't make a difference that all files are in 1 directory.

  12. #12
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,444

    Re: Email With Attachments - Failing

    Thanks bakerman2.

    Merry Christmas !

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,354

    Re: Email With Attachments - Failing

    You're welcome and thanks for adding rep points.
    Merry Christmas to you too.

+ 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: 10-19-2016, 11:37 AM
  2. Macro to create emai and attach picture for every unique email address.
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-12-2015, 11:45 AM
  3. Send multiple emails with different attachments if attachments found
    By AnkitJain in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2015, 05:35 AM
  4. Problem downloading excel items fro emai attachments
    By goofey44 in forum Excel General
    Replies: 2
    Last Post: 05-24-2014, 08:28 AM
  5. [SOLVED] An alternative to publishing as HTML in order to insert excel range to emai'sl body
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2014, 05:08 AM
  6. Pasting as picture into emai looks smalll
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2013, 08:04 AM
  7. Extracting out of a emai address string
    By harpscardiff in forum Excel General
    Replies: 6
    Last Post: 06-12-2006, 04:25 AM

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