Hello forum,
I have combined the code below from different pieces of codes that I have found online.
However, I would like to add the following to the code:
1. Open Outlook Program (if its not opened)
2. Paste the picture that was copied from excel, to the body of the email with the width set at 7.5"
3. Add the emails of a couple of folks
4. Send email out
If it possible can some please help.
Thank you
I have combined the code below from different pieces of codes that I have found online.
However, I would like to add the following to the code:
1. Open Outlook Program (if its not opened)
2. Paste the picture that was copied from excel, to the body of the email with the width set at 7.5"
3. Add the emails of a couple of folks
4. Send email out
If it possible can some please help.
Thank you
HTML:
Sub CreateMail()
Application.Calculation = xlManual
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Call Export
Dim TempFilePath As String
'Create a new Microsoft Outlook session
Set appOutlook = CreateObject("outlook.application")
'create a new message
Set Message = appOutlook.CreateItem(olMailItem)
With Message
.Subject = "Count"
.Display
End With
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Application.Calculation = xlCalculationAutomatic
Sub Export()
Dim rgExp As Range
Set rgExp = Range("A10:N104")
rgExp.CopyPicture Appearance:=xlScreen, Format:=xlScreen
With ActiveSheet.ChartObjects.Add(Left:=rgExp.Left, Top:=rgExp.Top, Width:=rgExp.Width, Height:=rgExp.Height)
.Name = "ChartEXPORT"
.Activate
End With
ActiveChart.Paste
ActiveSheet.ChartObjects("ChartEXPORT").Delete
End Sub
End Sub