The following Excel 2016 VBA code does open Outlook:
Sub mail()
Dim objOutlook As Object
Dim objMail As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.To = "Yourname@Yourdomain.com"
.Subject = "My Subject"
.Body = "My message."
.Display 'This creates and opens the Email. The user has to manually click the send button in Outlook afterwards
End With
End Sub
Now, the user has the valid option to immediately close Outlook.
However in this case, Outlook opens a pop-up window about whether or not to save changes.
Is there a way to prevent Outlook from opening this pop-up alert window by some Excel VBA code?