Set OutApp = CreateObject("Outlook.Application")
MsgBox (OutApp Is Nothing)
On Error GoTo errorHandler
Set OutMail = OutApp.CreateItem(0)
'OutMail.Parent.Display '****
On Error Resume Next
With OutMail
.To = cell.Value
.Subject = "Subject"
.Body = "Body"
.Se
End With
On Error GoTo errorHandler
Set OutMail = Nothing
If I want the email to be sent, I have to uncomment the OutMail.Parent.Display line. Why should I annoy the user like that by making outlook visible? Is this a security setting or something?
No it is not necessary 🙂 Also I guess
.Seis a typo in the code mentioned in the question?This works for me.