I am trying to figure out how to get a picture from a spreadsheet in Excel into the body of an Outlook message. Here's what I have so far:
It creates the picture from the grouping of data that I need,
copies it below, and
opens the mail with the initial message that I need
but I can't figure out how to link the two created images into the body of the email. As of now, I've been cutting them from each tab once created and just pasting them into the body.
Sub EmailDashboards()
Dim OutApp As Object
Dim outMail As Object
Sheets("CAM Dashboard Burdened").Select
Range("C1:J47").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Range("K36").Select
ActiveSheet.Paste
Sheets("CAM Dashboard Direct").Select
Range("C1:J47").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Range("K36").Select
ActiveSheet.Paste
Sheets("CAM Dashboard Burdened").Select
Range("K36").Select
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
Set outMail = OutApp.CreateItem(0)
With outMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "CCM EV Dashboard"
.Body = "Here are the latest Burdened and Direct EV Dashboards for your area: "
.Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set outMail = Nothing
Set OutApp = Nothing
End Sub