Mohammad Shafaat
New Member
Code:
Option Explicit
Sub Send_Email_With_snapshot()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sheet1")
ActiveWorkbook.RefreshAll
Dim lr As Integer
lr = sh.Range("A" & Application.Rows.Count).End(xlUp).Row
sh.Range("A1:AG48").Select
With Selection.Parent.MailEnvelope.Item
.to = "xyz@mail.com"
.cc = ""
.Subject = sh.Range("AN8").Value
.attachments.Add "D:\n.xlsx"
.send
End With
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit
End Sub
Last edited by a moderator: