on-internet
← Community

How to send worksheet in email body?

Stack Overflow ·

Is there any way I can attach as well as send a worksheet as an email body. The below VBA code sends the worksheet as an attachment. How can I send a worksheet in the body of email? Sub Email() Dim OutApp As Object Dim OutMail As Object Dim wbTemp As Workbook Dim strFilename As String Dim Sendrng As Range ThisWorkbook.Worksheets("Test Worksheet").Copy Set wbTemp = ActiveWorkbook wbTemp.SaveAs ThisWorkbook.Path & "/" & "TestWb", XlFileFormat.xlOpenXMLWorkbook strFilename = wbTemp.FullName Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) On Error Resume Next Wi

Comments

Sign in or sign up to comment and upvote.

No comments yet.