Home » VBA Code » Email Active Workbook

Email Active Workbook

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 1,342 other subscribers

 

Sub Send_Mail()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.to = "Harsh@Microsoft.com" 'set email id
.Subject = "Attendance Sheet" ' set subject line
.Body = "Hello, Please find attached Attendance sheet." ' set mail
.Attachments.Add ActiveWorkbook.FullName
.display ' if you want to see your mail body

'if you want to send mail directly without seeing the mail body change .display to . send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

 


Leave a comment

Blog Stats

  • 55,352 Viewers