title: Embedding image in html email from Excel VBA
body: <p>I'm trying to build an email that has both text and an image (chart from Excel) using HTML code. I merged code I found online.</p>
  
  <p>This is what I have so far for the image:</p>
  
  <pre><code>FirstChartPath = ThisWorkbook.Path &amp; "\Current Credit Usage.png"
  ChartName = "Current Credit Usage.png"
  'add the image in hidden manner, position at 0 will make it hidden
  .Attachments.Add FirstChartPath, olByValue, 0
  
  'Now add it to the Html body using image name
  
  'change the src property to 'cid:your image filename'
  'it will be changed to the correct cid when its sent.
  .HTMLBody = .HTMLBody &amp; "&lt;br&gt;&lt;B&gt;CURRENT CREDIT USAGE:&lt;/B&gt;&lt;br&gt;" _
    &amp; "&lt;img src='cid:Current Credit Usage.png'" &amp; "width='500' height='200'&gt;"
    '&amp; "&lt;br&gt;Best Regards, &lt;br&gt;Sumit&lt;/font&gt;&lt;/span&gt;"
  </code></pre>
  
  <p>I get an "X" in the image saying the linked image cannot be displayed.</p>
  
  <blockquote>
    <p>"The file may have been moved, renamed or deleted. Verify that the link points to the correct file and location"</p>
  </blockquote>