You can send an email from Excel VBA with your Outlook signature attached by creating the message with CreateItem and then calling .Display before you fill in the body or send it. The signature is inserted by Outlook itself when the message is displayed, not by your VBA code. If you set .Body or call .Send immediately, the signature is skipped. The reliable pattern is: create the mail item, display it, wait for Outlook to insert the signature, then prepend or append your text and send. This guide walks through that pattern, the common mistakes that strip the signature, and how to fix them.
What You'll Need
- Microsoft Excel with the Developer tab enabled (File > Options > Customize Ribbon > check Developer).
- Microsoft Outlook installed and signed in on the same Windows PC as Excel. This method uses Outlook automation; it does not work with the web version of Outlook alone.
- A default email signature already set in Outlook (File > Options > Mail > Signatures). VBA cannot create a signature from scratch; it can only let Outlook insert the one you already have.
- Macro security set to allow the workbook to run (File > Options > Trust Center > Trust Center Settings > Macro Settings).
Step-by-Step
Open Outlook once and confirm your signature is set as the default for new messages. In Outlook, go to File > Options > Mail > Signatures. Under "Choose default signature," set the New messages dropdown to the signature you want. Close Outlook. If this is not set, no amount of VBA will produce a signature.
In Excel, press Alt+F11 to open the Visual Basic Editor. In the Project pane, right-click your workbook and choose Insert > Module. This is where the macro will live.
Add a reference to the Outlook object library. In the VBA editor, go to Tools > References and tick "Microsoft Outlook Object Library." This lets Excel talk to Outlook directly. If you skip this, you can still use late binding, but early binding gives you autocomplete and clearer errors.
Paste the following skeleton into the module. Replace the placeholder address and subject with your own values:
Sub SendWithSignature() Dim olApp As Outlook.Application Dim olMail As Outlook.MailItem Set olApp = New Outlook.Application Set olMail = olApp.CreateItem(olMailItem) With olMail .To = "name@example.com" .Subject = "Report attached" .Display .Body = "Hello," & vbCrLf & vbCrLf & "Please find the report attached." & vbCrLf & vbCrLf & .Body .Send End With Set olMail = Nothing Set olApp = Nothing End SubThe key line is
.Display. It opens the message window, which is the trigger Outlook uses to insert the default signature. The next line reads.Body(which now contains the signature) and prepends your text above it.Run the macro with F5 while the cursor is inside the Sub. Outlook will open a new message window, briefly show it, insert the signature, add your text above it, and send. If Outlook shows a security prompt asking whether to allow access, click Allow. This prompt appears because Excel is programmatically controlling another Office app.
If you want to attach a file, add a line before
.Send:.Attachments.Add "C:\Reports\summary.xlsx". Use the full path with double backslashes in the string. The file must exist at that path when the macro runs, or you will get a run-time error.To send to multiple recipients, separate addresses with semicolons in the
.Tofield, for example"a@example.com; b@example.com". Do not use commas; Outlook expects semicolons.Save the workbook as an .xlsm file (File > Save As > Excel Macro-Enabled Workbook) so the code is kept. A plain .xlsx will strip the macro on save.
Common Mistakes
- Calling .Send without .Display. This is the single most common cause of a missing signature. Outlook inserts the signature only when the item is displayed. If you must send silently, you cannot rely on the default signature; you have to read the signature file and append it manually, which is fragile and not recommended.
- Setting .HTMLBody instead of .Body. Assigning to
.HTMLBodyoverwrites the entire message including the signature. If you need HTML formatting, read.HTMLBodyfirst and concatenate your HTML before the existing content. - No default signature set in Outlook. The macro is fine; the Outlook setting is missing. Check File > Options > Mail > Signatures before blaming the code.
- Using the wrong Outlook profile. If Outlook is signed in with a different account than the one whose signature you configured, the wrong signature (or none) appears.
- Forgetting the object library reference. Without it,
Outlook.Applicationis an unrecognized type and the macro fails to compile. - Leaving Outlook closed. The macro can launch Outlook, but if Outlook is mid-update or showing a dialog, the automation can hang.
Tips
- Keep the
.Displaythen.Sendsequence even if you do not want the user to see the window. It flashes briefly but guarantees the signature. - Store recipient addresses and subjects in worksheet cells and read them into variables. That way non-technical users can change them without touching code.
- Use
On Error GoTohandlers to close the mail item and release the Outlook objects if something fails, so Outlook does not accumulate hidden windows. - If you need a signature but want the message to stay open for editing rather than send, omit
.Sendand leave the.Displayline. The user reviews and sends manually. - Test with your own address first. A loop that sends 200 emails to real recipients is hard to undo.
Troubleshooting
If the signature does not appear, first open Outlook manually and create a new message. If the signature is missing there too, the problem is the Outlook setting, not VBA. Fix it in File > Options > Mail > Signatures and set the default for new messages.
If Outlook shows a programmatic access warning every time, that is normal for automation from another Office app. Click Allow. If the button is greyed out, your organization may block programmatic access via policy; in that case, the macro cannot send mail and you should use Outlook's own rules or a manual process instead.
If you get a "Run-time error 429: ActiveX component can't create object," Outlook is either not installed, not registered, or blocked. Repair the Office installation from Control Panel > Programs > Microsoft Office > Change > Repair. If the error persists, your IT policy may prohibit automation.
If the email sends but the body text appears above the signature with no blank line, add an extra vbCrLf before your text. If the signature appears twice, you are likely concatenating .Body into .HTMLBody as well; pick one property and stick to it.
If nothing happens when you press F5, check that the cursor is inside the Sub and that macros are enabled. A disabled macro shows no error; it simply does nothing.
Frequently Asked Questions
Can VBA create a signature if I don't have one in Outlook?
No. VBA can only let Outlook insert the signature you have already configured. You must set one in Outlook first.
Why does the signature only appear when I use .Display?
Outlook inserts the default signature when a message window is opened. Calling .Send directly bypasses that step, so the signature is never added.
Can I send from a shared mailbox with its own signature?
You can set the .SendUsingAccount property to the shared account, but the signature Outlook inserts is the default for the profile, not necessarily the shared mailbox's signature. Check the result carefully before relying on it.
Does this work on Mac?
Excel for Mac has limited support for Outlook automation and the object model differs. The steps above are for Windows. On Mac, use Outlook's own templates or manual sending.
Can I add an attachment and keep the signature?
Yes. Add .Attachments.Add after .Display and before .Send. The attachment does not affect the signature.
How do I stop the message window from flashing on screen?
You cannot fully suppress it if you want the signature, because the display step is what triggers it. The window appears for a fraction of a second. Sending without display means no signature.