title: Sending emails from Excel (2013) from an alternate (not main) Outlook (2013) account. (VBA)
body: <p>I've managed to get Excel to create emails in Outlook, from an alternate account, not my main one.</p>
  
  <p>The trouble is, they just sit in the second account Outbox, doing nothing. Note that I can send files from this account manually just fine.</p>
  
  <pre><code>Dim MyOlApp As Object
  Dim MyItem As Outlook.MailItem
  Dim AttachName As String
  Dim SendTo As String
  Dim CCTo As String
  Dim E, F, G As Integer
  Dim Sys_Date As String
  'Sys_Date = Format(Now(), "DD-MMM-YYYY")
  
  F = Application.WorksheetFunction.CountA(Sheets("Sheet2").Range("A:A"))
  'G = F
  
  
  For E = 2 To F
  
  Sheets("Sheet2").Select
  AttachName = Cells(E, 2).Value
  SendTo = Cells(E, 5).Value
  CCTo = Cells(E, 6).Value
  
  Set MyOlApp = CreateObject("Outlook.Application")
  Set MyItem = MyOlApp.CreateItemFromTemplate("C:\localDocuments\2 - Reporting\1 - Guides + Sample Data etc\Email.oft")
  MyItem.Display
  
  On Error Resume Next
  With MyItem
      Set .SendUsingAccount = MyOlApp.Session.Accounts.Item(2)
      .To = SendTo
      .CC = CCTo
      .BCC = ""
      .Subject = "Action required: " &amp; AttachName
      'You can add other files also like this
      .Attachments.Add ("C:\localDocuments\2 - Reporting\Reports\" &amp; AttachName &amp; ".xlsx")
      .Display
      .Send
  End With
  On Error GoTo 0
  
  Set MyItem = Nothing
  Set MyOlApp = Nothing
  
  
  Next E
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Whilst I've not been able to find the actual cause of the issue.  I have managed to find a very simple fix.</p>
  
  <p>I've created a new Outlook Profile, with just the alternate account that we need to send by and it works just fine.  This works perfectly as the code is only used once a week once a 3hr report has been run.  </p>
  
  <p>I can see that it would not be applicable to someone who was sending regular (throughout the day) emails in this way.</p>
  
  <p>For Reference, you access the profiles by WIN 8 SEARCH / MAIL (filter by SETTINGS), select MAIL and then VIEW PROFILES.</p>