Email with Attachments

Send emails with file attachments based on Excel data

170 views
Featured

Perfect For:

  • Send invoices
  • Distribute reports
  • Share personalized files

PRO Template

Sign up for free to unlock the complete VBA code and access all templates

VBA Code (Preview)
Sign up to copy
Sub SendEmailWithAttachments()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim ws As Worksheet
    Dim i As Long, lastRow As Long
    Dim filePath As String

    Set ws = ActiveSheet
    lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
    Set OutApp = CreateObject("Outlook.Application")

    For i = 2 To lastRow
        filePath = ws.Cells(i, 4).Value ' Assuming file path is in column D

        If Dir(filePath) <> "" Then ' Check if file exists

' ... 14 more lines hidden ...
'
' Sign up for free to view the complete code
' Visit: vbacode.io
Access all 45 templates
10 free AI generations/month
No credit card required

Related Topics

email attachments automation files

Need Custom VBA Solutions?

Our AI-powered VBA generator can create custom code tailored to your specific requirements in seconds.

Generate Custom VBA Code