VBA Send email via Outlook issue

gldurand

Board Regular
Joined
Jun 8, 2006
Messages
178
Office Version
  1. 2016
Platform
  1. Windows
Hi Guru's

I have the following VBA code that works very well for me, as i use application OUTLOOK 2016 as my email.

Set Mail_Object = CreateObject("Outlook.Application")
With Mail_Object.CreateItem(o)
.Subject = " "
.To = " "
.CC =
.body = " "

.Display ' change the line .Display to .Send, if you don't need to review the E-Mail

End With


The issue is that my colleague calls Outlook 2016 via CHROME and we get an executable error on

With Mail_Object.CreateItem(o)

Does anyone know what the OLE is to create object when calling Outlook via CHROME

Any help would be amazing

thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
So long as you have Excel, this will work no matter the browser :

VBA Code:
Option Explicit

Sub Mail_workbook_Outlook()

Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next

With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = ""
.Body = ""
.Display
End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top