Send Email from Excel VBA Using Outlook 365 or Outlook on the Web
Question details
The user needs to send email from an Excel workflow using a Microsoft 365 mailbox, either through Outlook desktop or Outlook on the web.

- Product
- Microsoft Excel and Microsoft Outlook 365
- Device & OS
- not provided
- Scenario
- An Excel macro or related workflow needs to send email through a configured Microsoft 365 account.
- Observed behavior
- Classic Outlook desktop supports Outlook Object Model automation, while Outlook on the web cannot be controlled through the same COM interface.
Check whether classic Outlook is installed and signed in on the computer running Excel. If you only use Outlook on the web, check that your organization allows Power Automate and the Office 365 Outlook connector.
Send Email with VBA and Classic Outlook Desktop
Use this approach when classic Outlook is installed and configured on the same computer as Excel.
This example uses late binding, so you do not need to add an Outlook library reference in the VBA editor. Outlook on the web and the new Outlook for Windows do not provide the classic Outlook COM automation interface used here.
In Excel, open the workbook, press Alt+F11, and select Insert > Module.
Paste this code into the module and replace the recipient and message text: Sub SendOutlookEmail() Dim outlookApp As Object Dim mail As Object Set outlookApp = CreateObject("Outlook.Application") Set mail = outlookApp.CreateItem(0) With mail .To = "recipient@example.com" .Subject = "Message from Excel" .Body = "Hello from Excel." .Send End With End Sub
In the VBA editor, place the cursor inside the macro and press F5. To review the message before sending, replace .Send with .Display, then select Send in the Outlook message window.
In Excel, select File > Save As and choose Excel Macro-Enabled Workbook (.xlsm) to keep the VBA code.

Send Email from Excel on the Web with Power Automate
Use a cloud flow when you have a Microsoft 365 mailbox but do not have classic Outlook desktop available.
Work with Excel Spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface, making it easy to open and continue working with existing Excel files. It does not provide a fix for Outlook COM automation or replace the Microsoft 365 mail setup described above.

Frequently Asked Questions
Can Excel VBA use CreateObject to control Outlook on the web?
No. CreateObject("Outlook.Application") uses the classic Outlook desktop COM interface. For a web-based mailbox, use a Power Automate flow or an application that calls Microsoft Graph.
How can I review an email before the macro sends it?
Replace .Send with .Display in the VBA code. Outlook opens the message so you can review it and select Send manually.
What does Microsoft Graph require to send email?
A Graph-based application needs a Microsoft Entra app registration, OAuth authentication, and the appropriate Mail.Send permission. Some organizations require administrator approval. A signed-in user's application can send through the /me/sendMail endpoint.
Why is my Excel table unavailable in Power Automate?
Check that the workbook is stored in OneDrive for Business or SharePoint and that the data is formatted as a table using Insert > Table. Then reselect the file and table in the Excel Online (Business) trigger.




