• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help on copying Pivot table data to outlook email

Hi All,

Need ur help to copy the pivot table data from pivot sheet of hosting-tending violate report xlsx file to body of the email. I have attached .png screenshot of output.

Note: If there is no data in the pivot table, i need to display in the message as "No violated tickets for incident"

I tried the below code but in the .body = I dnt know the code to copy and paste pivot table

Dim outlookOBJ As Object
Dim mItem As Object
Set outlookOBJ = CreateObject("Outlook.Application")
Set mItem = outlookOBJ.CreateItem(olMailItem)
With mItem
.To = ThisWorkbook.Sheets("Email Template").Cells(3, 2).Value
.CC = ThisWorkbook.Sheets("Email Template").Cells(4, 2).Value
.Subject = Queue & " - Tending Violate Report _" & Format(Now(), "DD-MM-YYYY")
.Body =
ThisWorkbook.Save
.Attachments.Add ThisWorkbook.Path & "\" & Queue & " - Tending Violate Report_" & Format(Now(), "DD-MM-YYYY") & ".xlsx"




output.PNG output.PNG
 

Attachments

  • Hosting - Tending Violate Report_30-05-2018.xlsx
    119.6 KB · Views: 5
Back
Top