{"text_format":"1","workbook":"xlsx","n_sheets":1,"sheets":["Sending Email from Excel"],"not_rendered":{"charts":0,"images":0,"macros":1,"external_links":0,"defined_names":2,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"Sending Email from Excel","index":0,"n_rows":61,"n_cols":2,"rows_kept":61,"cut":false,"hidden":false,"merged":[[21,0,21,1]]}
["Send a Spreadsheet by Email with a Macro"]
["By Rich Malloy"]
[]
["This spreadsheet shows two ways to send an Excel worksheet to someone via email."]
["Both techniques use Microsoft Outlook to send the email."]
["The first technique involves recording a macro."]
["The second involves writing an VBA subroutine."]
[]
["Recording a Macro"]
["The first technique involves automating the manual technique of using Excel's Share feature."]
["This was easy to create by recording the Share process (click: File > Share > Email)."]
["But this technique simply creates a message in Outlook. You then have to fill in the recipient's name and click Send."]
[]
[null,"In the Developer tab, click: Start Recording"]
[null,"Click: File > Share > Email"]
[null,"Click: Send as Attachment"]
[null,"Outlook will open up with a new message"]
[]
["Sending Email by VBA"]
["The second technique uses VBA code to call the Outlook application."]
["The actual code is listed below."]
["The code creates an Outlook object. It then takes the To: box data (in green below) and the Subject data (in yellow) and creates an email message in Outlook. It then either displays the message or sends it, depending on which command is commented out."]
[]
["Email Addresses:"]
[null,"richmalloy@gmail.com"]
[null,"malloy@techhelptoday.com"]
[]
[]
["To:",{"$f":"B25&\"; \"&B26&\"; \"&B27","v":"richmalloy@gmail.com; malloy@techhelptoday.com; "}]
[]
["Sub:","This is another test"]
[]
["Instructions:"]
[null,"Record a simple macro"]
[null,"Edit the macro"]
[null,"Replace the macro's instructions with the code below"]
[]
["Code:"]
[null,"' This code is adapted from www.rondebruin.nl"]
[]
[null,"    Dim OutApp As Object"]
[null,"    Dim OutMail As Object"]
[null,"    "]
[null,"    Set OutApp = CreateObject(\"Outlook.Application\")"]
[null,"    Set OutMail = OutApp.CreateItem(0)"]
[]
[null,"    With OutMail"]
[null,"        .to = Range(\"ToBoxData\")"]
[null,"        .CC = \"\""]
[null,"        .BCC = \"\""]
[null,"        .Subject = Range(\"SubjLine\")"]
[null,"        .Body = \"Hi there\""]
[null,"        .Attachments.Add ActiveWorkbook.FullName"]
[null,"        'You can add other files also like this"]
[null,"        '.Attachments.Add (\"C:\\test.txt\")"]
[null,"        .Send   'or use"]
[null,"        '.Display"]
[null,"    End With"]
[]
[null,"    Set OutMail = Nothing"]
[null,"    Set OutApp = Nothing"]