title: Excel VBA Sending emails with multiple attachements
body: <p>So we are holding this big event and I have an excel sheet with everyones name, email address as well as their itinerary files (there are 2 of them) <code>Cells(x, 3)</code> and <code>Cells(x, 4)</code>. What I am trying to do is go down the column and send everyone a 'personalized' email with all of their information. </p>
  
  <p>In the code, the <code>for</code> loop only goes to 3 because I am just testing it out by sending the emails to myself and don't want to end up getting 1000 emails :P</p>
  
  <p>I keep getting a <strong>Run-Time Error 440 (Automation Error)</strong> at the lines where I attempt to add the attachments... not sure what's going on or how to remedy it any help is appreciated</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>Sub CreateHTMLMail()
  'Creates a new e-mail item and modifies its properties.
  
      Dim olApp As Object
      Dim objMail As Object
      Dim body, head, filePath, subject As String
      Dim x As Long
      Set olApp = CreateObject("Outlook.Application")
      'Create e-mail item
      Set objMail = olApp.CreateItem(0)
  
      filePath = "\\fileserver\homeshares\Tsee\My Documents\Metropolitan Sales\MNF"
      subject = "Important Travel Information for MNF Event this weekend"
  
      x = 1
  
      For x = 1 To 3
          head = "&lt;HTML&gt;&lt;BODY&gt;&lt;P&gt;Hi " &amp; Cells(x, 1).Value &amp; ",&lt;/P&gt;"
          body = body &amp; "&lt;BR /&gt;&lt;P&gt;We are looking forward to having you at our &lt;STRONG&gt;Metropolitan Night Football Event&lt;/STRONG&gt; this upcoming Sunday, &lt;STRONG&gt;11/17&lt;/STRONG&gt;!  Note, that the Giants game time has changed from 8:30 PM to 4:25 PM.&lt;/P&gt;"
          body = body &amp; "&lt;BR /&gt;&lt;P&gt;Please find attached your travel information packet that contains important addresses and confirmation numbers.  Please read through it and let me know if you have any questions.&lt;/P&gt;"
          body = body &amp; "&lt;BR /&gt;&lt;P&gt;If you need to reach me this weekend, please call my cell phone &lt;STRONG&gt;(631) 793-9047&lt;/STRONG&gt; or email me.&lt;/P&gt;"
          body = body &amp; "&lt;BR /&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Liz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;"
  
          With objMail
              .subject = subject
              .To = Cells(x, 2).Value
              .Attachments.Add = filePath &amp; "/" &amp; Cells(x, 3).Value
              .Attachments.Add = filePath &amp; "/" &amp; Cells(x, 4).Value
              .BodyFormat = olFormatHTML
              .HTMLBody = head &amp; body
              .Send
          End With
      Next x
  
  End Sub
  </code></pre>