(Fast read!) Send out email automatically with attachment through command button

David77

Board Regular
Joined
Jun 24, 2020
Messages
85
Office Version
365
Platform
Windows
Hello everybody,

Goal: I am currently trying to create a command button in Excel that, when one clicks on it, sends out an email to me with an order that one has entered into Excel. The following link here: Using Excel VBA to Send Emails with Attachments - wellsr.com has a nice VBA code that goes sends out the email automatically, but does not add the attachment from what I understood when I tried it.

Likewise, this link here has a nice VBA code that adds the attachment, but does not send out the email automatically (under the second title, named: "
Email Selected Worksheets As Outlook Attachment": The VBA Guide To Sending Excel Attachments Through Outlook — The Spreadsheet Guru

Is there an Excel genius here who can help me combine these codes so I can get a command button which, when clicked on, sends out an email automatically to my own email with the Excel sheet attached?

I know this is a lot to ask for, but I would REAAALLY appreciate this! I have been struggling for the past 10+ hours with this and cannot find a solution to this and whenever I try I get "compile error, user-defined type not defined" and more errors in my worksheet.

Thank you so much for your time!

Best regards,
David
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,649
Office Version
2016
Platform
Windows
David I have just replied to your earlier request on the same subject. You don't need to create a new thread.


The code is in my reply and tested and works
 

David77

Board Regular
Joined
Jun 24, 2020
Messages
85
Office Version
365
Platform
Windows
David I have just replied to your earlier request on the same subject. You don't need to create a new thread.


The code is in my reply and tested and works
Hello Trevor,

My apologies! Please see my response in the other thread.

Best regards,
David
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,105,963
Messages
5,508,418
Members
408,685
Latest member
kyrendaniel

This Week's Hot Topics

Top