Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to send email with multiple attachments attached in Excel?

This article is talking about sending an email through Outlook with multiple attachments attached in Excel.

Send email with multiple attachments attached in Excel with VBA code

Quickly send email with multiple attachments attached in Excel with Kutools for Excel

Send email with multiple attachments attached in Excel with VBA code

Please do as follows to send an email with multiple attachments attached in Excel.

1. Please insert a command button by clicking Developer > Insert > Command Button (ActiveX Control). See screenshot:

2. After inserting the Command Button, please right click it and select View Code from the context menu.

3. In the opening Microsoft Visual Basic for Applications window, please click Tools > References as below screenshot shown.

4. In the References – VBAProject dialog box, please find and check the Microsoft Outlook Object Library option, and then click the OK button.

5. Then replace the original code in the Code window with below VBA code.

VBA code: Send email attached with multiple attachments in Excel

Private Sub CommandButton1_Click()
    Dim xStrFile As String
    Dim xFilePath As String
    Dim xFileDlg As FileDialog
    Dim xFileDlgItem As Variant
    Dim xOutApp As Outlook.Application
    Dim xMailOut As Outlook.MailItem
    Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    Set xFileDlg = Application.FileDialog(msoFileDialogFilePicker)
    If xFileDlg.Show = -1 Then
        With xMailOut
            .BodyFormat = olFormatRichText
            .To = "happy.xuebi@163.com"
            .Subject = "test"
            .HTMLBody = "test"
            For Each xFileDlgItem In xFileDlg.SelectedItems
                .Attachments.Add xFileDlgItem
            Next xFileDlgItem
        End With
    End If
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

Note: please specify your email recipient, subject, and body by changing the variate in .To = happy.xuebi@163.com, .Subject = "test" and .HTMLBody = "test" lines in the code.

6. Press the Alt + Q keys together to exit the Microsoft Visual Basic for Applications window.

7. Click Developer > Design Mode to turn off the Design Mode. See screenshot:

8. Click the Command Button to run the code. In the popping up Browse window, select the files you need to attach in the email, and then click the OK button. See screenshot:

9. Then an email is created with specified fields and attachments listed out. Please click the Send button to send it. See screenshot:

Note: The VBA code is only working when you use Outlook as your email program.

  Quickly send email with multiple attachments attached in Excel with Kutools for Excel

This section will recommend you the Send Emails utility of Kutools for Excel. With this utility, you can easily send email with multiple attachments attached in Excel. Please do as follows.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

1. Follow as the below screenshot shown to create a mailing list. And fill in the recipient’s email address, the email subject, and the paths of attachments you need to attach in the sending email.

2. Select the whole mailing list you have created just now (here I select range A1:E2), then click Enterprise > Send Emails. See screenshot:

2. In the popping up Send Emails dialog box, please do the following configurations:

A. The To, Attach files and Subject fields will be filled with the selected mailing lists automatically;

B. Compose the email body as you need;

C. Check the Send email via Outlook box;

D. Click the Send button to send the email. See screenshot:

3. Then a Kutools for Excel dialog box pops up to tell you how many emails have been sent. Please click the OK button and close the Send Emails dialog box. See screenshot:

Note: You can go to the Outlook’s Sent Items folder to check for the sending emails.

Tip.If you want to have a free trial of this utility, please go to download the software freely first, and then go to apply the operation according above steps.

Related articles:

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Regina · 4 months ago
    the above code works perfectly thanks!! but my email automatic signature seem to disappear with this code. any idea why?
  • To post as a guest, your comment is unpublished.
    Rizwan Siddiqui · 11 months ago
    What if multiple different user and different attachment to be send with different subject line.
  • To post as a guest, your comment is unpublished.
    Prashant Soni · 1 years ago
    What if above files are located in sub-folders? How to look for a file in folder and sub-folders?
  • To post as a guest, your comment is unpublished.
    Laurel Granger · 1 years ago
    I am able to "Quickly send email with multiple attachments attached in Excel with Kutools for Excel" using your steps above, but would like to take it one step further and personalize each email by inserting their names (from a column in the Excel sheet) into the body of the email. While in the body of the email, I try selecting the field and clicking on "Insert Placeholder" but nothing happens. Any idea why or how I can fix this? Thank you!