title: Excel VBA code works only when Outlook is visible
body: <pre><code>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
  </code></pre>
  
  <p>If I want the email to be sent, I have to uncomment the <code>OutMail.Parent.Display</code> line. Why should I annoy the user like that by making outlook visible?  Is this a security setting or something?</p>