Excel VBA Video Training/ EXCEL DASHBOARD REPORTS

Ozgrid, Experts in Microsoft Excel Spreadsheets

Send Emails From Excel

 

Send Email From Excel. VBA Code to Send an Email from Excel

Current Special! Complete Excel Excel Training Course for Excel 97 - Excel 2003, only $145.00. $59.95 Instant Buy/Download, 30 Day Money Back Guarantee & Free Excel Help for LIFE!

Got any Excel Questions? Free Excel Help

Send Email From Within Excel. See Also Outlook Add-ins & Example Code for sending mail from Excel 

Excel VBA allows us to send emails from within Excel and even send the Workbook as an attachment.

SendMail Method

The SendMail Method is very easy to use and will send any specified Excel Workbook as an attachment to specified recipients. As the code below specifies the Active Workbook the code is best stored in your Personal.xls

Sub SendActiveWorkbook()

    ActiveWorkbook.SendMail _

    Recipients:="[email protected]", _

    Subject:="Try Me " & Format(Date, "dd/mmm/yy")

End Sub

If you only wish to send one Worksheet from a Workbook we can use the method shown below. It creates a new Workbook housing ONLY the sheet we copy. It then sends the 1 sheet Workbook as an attachment, then closes the new Workbook without saving.

Sub Send1Sheet_ActiveWorkbook()

'Create a new Workbook Containing 1 Sheet (left most) _

 and sends as attachment.

 

    ThisWorkbook.Sheets(1).Copy

    

    

    With ActiveWorkbook

         .SendMail Recipients:="[email protected]", _

          Subject:="Try Me " & Format(Date, "dd/mmm/yy")

         .Close SaveChanges:=False

    End With

    

End Sub

Route Method

Another method we can use is the Route Method, it routes the workbook, using the workbook's current routing slip. This allows us to specify numerous recipients and have the Workbook send to the next in the routing slip. When sent, the text below is automatically added to the body of the email;

The enclosed document has a routing slip.  When you are done reviewing this document, choose Send To from the Microsoft Office Excel File menu.  Then select Next Routing Recipient to continue the routing.

In the case of the code below, the Workbook would first be sent to dump@ozgrid who would take the needed action and then go File>Send to>Next Routing Recipient and the Workbook would then be automatically sent to the next Recipient at [email protected]

Sub RouteActiveWorkbook()

    With ActiveWorkbook

       .HasRoutingSlip = True

           With .RoutingSlip

                .Delivery = xlOneAfterAnother

                .Recipients = Array("[email protected]", _

                    "[email protected]", "[email protected]")

                .Subject = "Check This Out"

                .Message = "Please fill in the Workbook and send it on."

          End With

        .Route

    End With

End Sub

Send Email From Within Excel. See Also Outlook Add-ins & Example Code for sending mail from Excel 

Excel Dashboard Reports & Excel Dashboard Charts 50% Off Become an ExcelUser Affiliate & Earn Money

Special! Free Choice of Complete Excel Training Course OR Excel Add-ins Collection on all purchases totaling over $64.00. ALL purchases totaling over $150.00 gets you BOTH! Purchases MUST be made via this site. Send payment proof to [email protected] 31 days after purchase date.


Instant Download and Money Back Guarantee on Most Software

Excel VBA Video Training/ EXCEL DASHBOARD REPORTS

Excel Trader Package Technical Analysis in Excel With $139.00 of FREE software!

Microsoft � and Microsoft Excel � are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft

Some of our more popular products are below...
Convert Excel Spreadsheets To Webpages | Trading In Excel | Construction Estimators | Finance Templates & Add-ins Bundle | Code-VBA | Smart-VBA | Print-VBA | Excel Data Manipulation & Analysis | Convert MS Office Applications To...... | Analyzer Excel | Downloader Excel | MSSQL Migration Toolkit | Monte Carlo Add-in | Excel Costing Templates