Reputation: 1796
I am trying to send an email using Excel with this code :
Sub SEND_EMAIL()
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
' ADRESSE
olMail.To = "[email protected]"
' Subject
olMail.subject = "Line"
' BODY
olMail.body = "this"
olMail.Send
When starting this macro i have the following error
The error is in the last line (olMail.Send)
And every time i am trying to send an email outlook is starting to update and after a moment it's showing error
Exception de HRESULT : 0x80004004 (E_ABORT)
Upvotes: 1
Views: 469
Reputation: 49397
You see a security issue (earlier prompts) because Outlook is configured on the client computer in one of the following ways:
You can create a group policy to prevent security prompts from displaying if any up-to-date antivirus software is installed on the system or just turn these warning off (which is not really recommended).
Read more about that in the Security Behavior of the Outlook Object Model article.
You may consider using the following workarounds:
Upvotes: 1