![]() ALL YOUR EXCEL & SOFTWARE NEEDS |
![]() |
| FREE Excel STUFF |
| Advanced Search |
| PRODUCTS |
| Development |
| Contact Us |
Excel Online |
GIVE YOURSELF OR YOUR COMPANY 24/7 MICROSOFT EXCEL SUPPORT & QUESTIONS
| Complete Excel Excel Training Course. Instant Buy/Download, 30 Day Money Back Guarantee FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package | Catalog | MORE.. |
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 sendingmail 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:="dump@ozgrid.com", _ 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:="dump@ozgrid.com", _ 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 Recipientat ok@ozgrid.com
Sub RouteActiveWorkbook() With ActiveWorkbook .HasRoutingSlip = True With .RoutingSlip .Delivery = xlOneAfterAnother .Recipients = Array("dump@ozgrid.com", _ "ok@ozgrid.com", "zach@ozgrid.com") .Subject = "Check This Out" .Message = "Please fill in the Workbook and send it on." End With .Route End WithEnd SubSend Email From Within Excel. See Also Outlook Add-ins & Example Code for sendingmail from Excel
Excel Dashboard Reports & Excel Dashboard Charts 50% Off
Special! Free Choice of Complete Excel Training Course OR Excel Add-ins Collection on all purchases totaling over $64.00. ALLpurchases totaling over $150.00 gets you BOTH! Purchases MUST be made via this site. Send payment proof to special@ozgrid.com 31 days after purchase date.
Instant Download and Money Back Guarantee on Most Software
Excel Trader PackageTechnical 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
GIVE YOURSELF OR YOUR COMPANY 24/7 MICROSOFT EXCEL SUPPORT & QUESTIONS