Good Morning.
I am running a Macro which Is exporting a range to pdf and attaching it to an email.
Id like to add a summarise the PDF by copying a specific range of cells into the body of the email which has been prepared.
I have already wasted far too much time researching this and trying to modify my original code with no joy..
Any help would be greatly appreciated
Thanks in advance
Code below which needs modifying to copy the range:
Range which needs copying to outlook is in (sheet 1 range Y4:Z24)
Sub Send_Email()
Dim wPath As String, wFile As String
wPath = ThisWorkbook.Path
wFile = "Filepdf.pdf"
Sheets("Production Scheduler").Activate
ActiveSheet.Select
ActiveSheet.Range("c2:HO86").ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = "email@email"
dam.Subject = "**3 Hourly Update**"
dam.Body = "Hi, See attached Update"
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
End Sub
I am running a Macro which Is exporting a range to pdf and attaching it to an email.
Id like to add a summarise the PDF by copying a specific range of cells into the body of the email which has been prepared.
I have already wasted far too much time researching this and trying to modify my original code with no joy..
Any help would be greatly appreciated
Thanks in advance
Code below which needs modifying to copy the range:
Range which needs copying to outlook is in (sheet 1 range Y4:Z24)
Sub Send_Email()
Dim wPath As String, wFile As String
wPath = ThisWorkbook.Path
wFile = "Filepdf.pdf"
Sheets("Production Scheduler").Activate
ActiveSheet.Select
ActiveSheet.Range("c2:HO86").ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = "email@email"
dam.Subject = "**3 Hourly Update**"
dam.Body = "Hi, See attached Update"
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
End Sub