Send Email From Excel along with Data | Automate Your Daily Report |

Published 2023-06-17
In this video, we will explore how to automate the process of sending emails directly from Excel, including charts, with just a single click.

We will walk through a step-by-step demonstration of a VBA code that achieves this functionality. By leveraging the power of Microsoft Outlook and Excel, you can effortlessly generate and send emails containing Excel data and charts.

Watch the video to learn how to streamline your communication and reporting tasks using this efficient method.

CODE :-

Sub CopyPasteToOutlookEmail()

'Decalre avriable

Dim OutlookApp As Object
Dim OutlookMail As Object
Dim EmailAddress As String
Dim SubjectLine As String
Dim BodyContent As String

Dim wb As Workbook
Dim filePath As String


' Copy the content from Excel
Worksheets("snap").Cells.Select
Selection.Copy


' Create a new Outlook instance
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)

' Set the email properties
With OutlookMail
.To = "[email protected]"
.Cc = "[email protected]"
.BCc = "[email protected]"
.Subject = "Login Report - " & Format(Date, "mm/dd/yyyy")
.Display ' Use .Send to send the email immediately without displaying it

.GetInspector.Activate ' Activate the email inspector window
.GetInspector.WordEditor.Windows(1).Selection.TypeText "Hi Sir" & vbCrLf & vbCrLf & "PFA" & vbCrLf & vbCrLf ' Type "PFA" and line space
.GetInspector.WordEditor.Windows(1).Selection.Paste ' Paste the copied content
.GetInspector.WordEditor.Windows(1).Selection.TypeText vbCrLf & "Regards" & vbCrLf & "Excel Online Advisor"
End With

' Clean up the Outlook objects
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub

-------------------------------------------
Welcome to Excel Online Advisor, where we share expert tips and tricks for mastering Microsoft Excel.

✅ Excel Secrets -    • Excel Secrets: 2 Unknown Tricks #micr...  

✅ Need Help ? Ping Here (Telegram) - t.me/+UAVHfg7OMBk5M2M1

✅ Instagram - www.instagram.com/excelonlineadvisor/

All Comments (1)