+ Reply to Thread
Results 1 to 25 of 25

Sending email from excel

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Sending email from excel

    I have a code that will send my invoice from excel to outlook and send as a PDF email. The code works perfect except sometimes the email is stuck in outbox,could be number of reasons such as poor internet connection. My question is has anyone found a way to have a message pop up saying email sending then close the message after mail sent? Is there a way to put the number of outbox emails in a cell in excel. IF I could get the number in a cell might find a way for message box.Any suggestions on this?
    Thanks
    Last edited by zplugger; 01-16-2017 at 09:08 PM.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sending email from excel

    Hello zplugger,

    You are a real opportunist!

    What you are asking for, might be possible, with VBA Code longer than the full volume of an encyclopedia, and even then it may disappoint you. I suggest you pick up your lazy frozen fingers, and check the Status of your Emails.

    You are still young enough after all, and the exercise will do you only good!

    Now, go and check your Emails, dammit!

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: Sending email from excel

    What if you just put messagebox after sending mail?
    if it reach it then mail is sent, right?

    And code will be stoped at that point so you will know.
    Never use Merged Cells in Excel

  4. #4
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Thank You Mr.Winon

    VBA Code longer than the full volume of an encyclopedia, can't have that because book too big now. Status of Emails , that is what I need because young man I'm getting
    lazy. Maybe I need a different approach to this problem,instead of excel doing the work have outlook do the macro. Right now my code will open outlook and I close it when I shut down the computer.I need a macro in outlook that will close the program after the outbox is empty. So excel will open outlook and outlook will close itself after mail is sent. What do you think about this idea?.

    Thanks for your input and some more suggestions.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sending email from excel

    Dear Mr. zplugger,

    You Sir., appears to be consistent at plugging into issues so trivial that it amazes me that the Forum even allows your Posts.

    To add to your demise and fruitless quest for a ready solution to your issue at hand, which I blatantly and on purpose refuse to give you the answer, please clean your glasses, put them on, turn on your Computer and access the Internet. If you can manage that, and have successfully done so, and if you are capable of concentrating any further, OUCH!, then please see this link: http://www.mrexcel.com/forum/excel-q...lications.html

    Now, don't fall asleep yet, and get your Grandson to read and explain to you, what you have to do. Once Grandson have helped you sorting out that bit, rather get him to contact me, so I can guide him further, instead of me wasting my time with you.

    Snoring already. We are very much the same!

  6. #6
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Thank You again Mr. Winon
    I will check out your link and inform you how I do in couple days. I know you must be younger then I, I can't stay up past 10. LOL

    The more I think about it the more I think a macro in outlook to do job. Just a message box prompt after mail is sent and outbox is empty to close outlook.
    Last edited by zplugger; 01-15-2017 at 07:30 PM.

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sending email from excel

    Mr. zplugger,

    It is all in the mind, if you posses one, time here now is 01:33am, and I am committed to helping other people, so stop bothering me. How did you get pass the Ban of posting on this Forum anyway, you "Monster"

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sending email from excel

    I dare you! Spot the mistake in my post, above.

  9. #9
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Maybe a better way is to use display instead of send. Then I would have to send it. LOL


    lets see (Helping)

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sending email from excel

    Now that is really brilliant, if it is your own idea, without anyone else helping you!

    But then again, off course you will deny any help,

  11. #11
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Now, don't fall asleep yet, and get your Grandson to read and explain to you, did what you told me too.

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sending email from excel

    Now, don't fall asleep yet
    My dear son, wait 'till you reach my age, perhaps only then you will understand that I am sleeping already!

    "Gnight" my Friend.

  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,344

    Re: Sending email from excel

    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.

  14. #14
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Thanks bakerman2

    Ok I get From and Subject in A1, but nothing in A2. I know there is email in outbox
    Last edited by zplugger; 01-15-2017 at 09:45 PM.

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

    Re: Sending email from excel

    Did you set Reference to Outlook Library ?

  16. #16
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Thank You again bakerman2
    It was the Reference Library not checked,I just need to tweak a message box to tell me outbox has mail before I close the workbook. This is
    a great start,just got to link a message box to the cell with info.

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

    Re: Sending email from excel

    How about this ?
    Put the code in ThisWorkbook and before closing check will be performed.
    If there's still some mail present messagebox will appear and workbook will not close, otherwise workbook closes normally.

    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    I have to say this is almost perfect,think I will try and add a yes or no on closing in outbox has mail. Thank You very much for your help on this bakerman2

    The more I play with this the better it gets,Outlook can be closed and it works.
    Last edited by zplugger; 01-16-2017 at 07:10 PM.

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

    Re: Sending email from excel

    You're welcome and thanks for adding rep points.

  20. #20
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Doing something wrong on Yes or No ?
    Please Login or Register  to view this content.

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

    Re: Sending email from excel

    Please Login or Register  to view this content.
    When no mail present you will be prompted to Close Outlook, when Yes clicked Outlook will close and workbook will close.
    Otherwise both will stay open.

  22. #22
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    Thanks bakerman for hanging in there with me,I did not explain very good. The code in post #17 is perfect if it had option yes or no to close the workbook. Sometimes I email a invoice without internet connection and it goes to outbox to be sent later.I don't email all invoices so outlook is not used all the time, so don't need reason to close it sometimes. Can a Yes or no be addes to post #17 ? yes would close workbook and outlook and no would leave both open.

    Thanks

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

    Re: Sending email from excel

    Try.

    Please Login or Register  to view this content.

  24. #24
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Sending email from excel

    You are the Master bakerman2, works Perfect. Again thank you for hanging with this old man.

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

    Re: Sending email from excel

    You're welcome again and glad we got it going.

+ 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. Search & Replace in email body when sending an email with Excel
    By DreamEyes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2016, 07:52 AM
  2. Replies: 4
    Last Post: 01-30-2016, 02:13 PM
  3. Replies: 0
    Last Post: 11-24-2015, 03:29 AM
  4. 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
  5. 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
  6. Sending HTML email via excel VBA - arriving as RTF email
    By Shuter1 in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 04:35 AM
  7. Sending an email from Excel to multiple email addresses
    By insanity66 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2009, 02:01 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