How to Send Excel File to Email Automatically.

August 14, 2019

Automatically sending an excel file to someone via an email, can be accomplished easily and with ease. Following the brief guide below you will be able to do this in no time at all. From the basics to a more complex approach, here we have provided all the information you need to start sending files directly to email. While most people won’t ever use this, it is better to know it and not need it than to need it and not know it.

There are different approaches for this same purpose, we take pride in presenting the easiest and fastest one. For the guide below we will be using the Outlook platform and we’ll take the VBA approach. Without further ado we present.

How to send excel file to email automatically.

Let’s begin with the basics, first you want to make a separate sheet for the following process.

Step 1.

In the new sheet you want to use different columns for different fields of information. In this example column A will be destined for the name of the recipient, column B for their email addresses and column C will be used for the file names. In this case instead of using file names you want to use the route of the file.

Step 2.

Now this is the main part, you want to open the VBA editor by using the shortcut Alt + F11. Then you can use Ctrl + r to open the project explorer. After that, you need to insert a module in your project before you can use it for the code. Click on Insert and then on Module.

working on excel sheet

Step 3.

Now you should click in the project explorer and then press F7, or simply double click on the newly created module. A new window should open up, this is where the interesting happens. Now you want copy and paste the code below.

Sub Send_Files()
'Working for Excel 2000-2016
Dim OutApp As Object
Dim OutMail As Object
Dim sh As Worksheet
Dim cell As Range
Dim FileCell As Range
Dim rng As Range
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set sh = Sheets("Sheet1")
Set OutApp = CreateObject("Outlook.Application")
For Each cell In sh.Columns("B").Cells.SpecialCells(xlCellTypeConstants)
'Enter the path/file names in the C:Z column in each row
Set rng = sh.Cells(cell.Row, 1).Range("C1:Z1")
If cell.Value Like "?*@?*.?*" And _
Application.WorksheetFunction.CountA(rng) > 0 Then
Set OutMail = OutApp.CreateItem(0)
With OutMail
.to = cell.Value
.Subject = "Testfile"
.Body = "Hi " & cell.Offset(0, -1).Value
For Each FileCell In rng.SpecialCells(xlCellTypeConstants)
If Trim(FileCell) <> "" Then
If Dir(FileCell.Value) <> "" Then
.Attachments.Add FileCell.Value
End If
End If
Next FileCell
'Or use .Display
End With
Set OutMail = Nothing
End If
Next cell
Set OutApp = Nothing
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub

Step 4.

After That’s done you want to use Alt + q to go back to your Excel sheet. When that's done, you can use Alt + F8 to run the newly created macro.


Do be sure to inspect the code we have provided for you and change it in any way you deem necessary. Remember that this should be done to suit your needs. Also, leep present that in order for this macro to run you need to have your Outlook client active or minimized, but open.


With this brief process you’re able to automatize the process of sending files to emails. All that it’s needed for this is to run the macro we have provided for you. You can make your work a lot easier and faster with this option, this is likely to increase your workflow just by knowing how to best take advantage of your Microsoft Excel software and Outlook client. If you like this kind of content and want to see more, please be sure to visit us at our blog.

January 21, 2022
Finding The Best Online Email Verifier: Unlimited and Free

Yes, we get your frustration. The constant worry of finding a time-saving and accurate online email verifier is real. You have to scour endless online platforms, offering unlimited checks, without burning a hole in your pocket. And why won't you be frustrated? The right tool can do wonders for you and your business’s reputation. Image […]

Read More
January 14, 2022
The Best Free Tool For Email Verification In 2022

Verified email addresses are essential for any company hoping to succeed with email marketing. As a result, it's critical to double-check that your email address list is correct, error-free and that they actually exist. Mistakes happen, and it's not uncommon for your subscribers to make errors in their email addresses while subscribing to your list. […]

Read More
January 8, 2022
Bulk Email Verifiers: Your Complete Guide To Email Checkers

B2B sales reps rely heavily on email marketing. Being one of the fastest and least expensive methods to address the mass target audience, its popularity is unsurprising. However, the key to success here is a sound sender reputation. Your reputation to the internet service providers(ISPs) determines the deliverability proficiency of your bulk emails. Misinformation may […]

Read More
December 29, 2021
How To Do Email Verification For Free In 2022

No one wants to end up in a spam folder, and no one wants to receive spam emails in the first place. In the B2B world, email verification is a must. To avoid delivering your emails to malicious or fraudulent addresses, you must evaluate the quality and deliverability of your email list. Photographer: Stephen Phillips […]

Read More