add chart into email body

orsm6

Active Member
Joined
Oct 3, 2012
Messages
496
Office Version
  1. 365
Platform
  1. Windows
Hi everyone - there's a few threads on something like what i want to do, but mine (as usual) i think is a little more complex, so I need some expert help please.

Our file has the macro below to generate an email with some basic text etc.
Code:
Sub CopyAndPasteToMailBody()
        x = Worksheets("Governance").Range("A1").Value
        For u = 7 To 107

    If Worksheets("Master").Cells(u, 6).Value = Worksheets("Governance").Cells(x, 3).Value Then
        Worksheets("Master").Cells(u, 10).Value = "yes"
    Else
        Worksheets("Master").Cells(u, 10).Value = "No"
    End If
    Next
           
    Dim OutApp As Object
    Dim OutMail As Object
    Dim cell As Range
 
    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
 
    On Error GoTo cleanup
       
    For Each cell In Sheets("Master").Columns("G").Cells.SpecialCells(xlCellTypeConstants)
        If cell.Value Like "?*@?*.?*" And LCase(cell.Offset(0, 3).Value) = "yes" Then
            Set OutMail = OutApp.CreateItem(0)
 
        On Error Resume Next
            With OutMail
                .To = cell.Value
                .Subject = "New Action Point"
                .body = "Dear " & cell.Offset(0, -1).Value & "," & vbNewLine & vbNewLine & "Please review the summary below and proritise addressing any outstanding actions." & vbNewLine & vbNewLine
                .send  'Or use Display
            End With
        On Error GoTo 0
            
            Set OutMail = Nothing
        End If
    Next cell

cleanup:
    Set OutApp = Nothing
    Application.ScreenUpdating = True
    
End Sub

what I was hoping was to be able to get Chart1 on sheet "Governance" (sheet2) and copy or embed it into the body of the email.
Would anyone be able to help?

I do not mind if the chart needed to be exported to disk first, but would need to be deleted after email sent via macro.

TIA
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top