title: Excel VBA addPicture by path to image
body: <p>I've written an VBA Macro on windows. This Macro adds pictures into my excel sheet based on the value of a cell e.g. 'image.png'. These images are located in the same directory as my Excel workbook. VBA will get the path to the workbook and use it to find the image specified in the cell. This works on windows, however it does not work on mac. The macro returns an error (1004) saying it can't find the specified file.</p>
  
  <pre><code>Sub InsertImage()
      Dim useless As Double
      Dim clTop As Double
      For Each c In ActiveSheet.Range("C3:C200").Cells
         If c.Value = "" Then
             useless = 1
         Else
             Set cl = Range(c, c.Offset(0, 1))
             clTop = cl.Top
             ActiveSheet.Shapes.AddPicture _
             Application.ActiveWorkbook.Path &amp; "\" &amp; c.Value, _
             True, True, 500, clTop, 140, 140
         End If
      Next
      End Sub
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Did some more testing: When I first manually add all the pictures that I want to add, then immediatly delete them all, then run exactly the same Macro, all the pictures are imported perfectly fine. Could this be a bug in Excel for Mac?</p>