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

Поделиться
HTML-код
  • Опубликовано: 31 май 2024
  • 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 = "exceladvisorr@gmail.com"
    .Cc = "1+exceladvisorr@gmail.com"
    .BCc = "2+exceladvisorr@gmail.com"
    .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 Unkno...
    ✅ Need Help ? Ping Here (Telegram) - t.me/+UAVHfg7OMBk5M2M1
    ✅ Instagram - / excelonlineadvisor

Комментарии •