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.
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
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