Add Workbook to a Mail Attachment - VBA

%3CLINGO-SUB%20id%3D%22lingo-sub-2792090%22%20slang%3D%22en-US%22%3EAdd%20Workbook%20to%20a%20Mail%20Attachment%20-%20VBA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2792090%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH4%20id%3D%22toc-hId-352248331%22%20id%3D%22toc-hId-352248339%22%20id%3D%22toc-hId-352248339%22%20id%3D%22toc-hId-352248339%22%3EIs%20there%20a%20VBA%20code%20to%26nbsp%3BAdd%20Workbook%20to%20a%20Mail%20Attachment%20%3F%3C%2FH4%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2792090%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2792352%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20Workbook%20to%20a%20Mail%20Attachment%20-%20VBA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2792352%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1169019%22%20target%3D%22_blank%22%3E%40SaraAb%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftrumpexcel.com%2Fsend-single-excel-worksheet-email-attachment%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAttach%20workbook%20to%20an%20email%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello,

 

Is there a VBA code to Add Workbook to a Mail Attachment ?

2 Replies

@SaraAb 

Here is a VBA code and an example file.

 

Sub Excel_Workbook_send_with_Outlook_()
Dim Nachricht As Object, OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim AWS As String
'The active workbook is sent as a mail
AWS = ThisWorkbook.FullName
InitializeOutlook = True
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
        .To = "lino.excelsius@gmail.com"
        .Subject = " Test report from Microsoft Excel Community " & Date & Time
        .attachments.Add AWS
        .Body = "This is a Test." & vbCrLf & " Please ignore this message "
        'The mail is displayed again here
         .Display
         'Here the mail is immediately placed in the outbox
         'Mail.Send
End With
End Sub

 

 

 

At the same time, I can only recommend this site.

Mail from Excel

 

I would be happy to know if I could help.

 

NikolinoDE

Was the answer useful? Mark them as helpful!

This will help all forum participants.