title: Using VBA to insert and keep images in file - Excel 2013
body: <p>I'm working on a macro for a friend of mine who needs to import a set of images in an excel document and later use this document on other computers. The problem I encountered is that when opening this document on a different computer, all the images are gone and instead you get these little error signs, indicating that the image path could not be found.</p>
  
  <p>I have developed the macro on my own computer where I have Excel 2007 and for me, the code works perfectly fine. My friend uses Excel 2013 and apparently, there seems to be a major difference on how those 2 versions deal with the image importing and saving.</p>
  
  <p>Overall, I found 2 different ways how to insert images. The first one I tried was something similar to this:</p>
  
  <pre><code>Set pic = ActiveSheet.Pictures.Insert("C:\documents\somepicture.jpg")
  </code></pre>
  
  <p>The second way of doing this looked like this:</p>
  
  <pre><code>Set pic = Application.ActiveSheet.Shapes.AddPicture("C:\documents\somepicture.jpg", False, True, 1, 1, 1, 1)
  </code></pre>
  
  <p>In the documentation for this 2nd approach it is said that the 3rd paramenter (which is True here) is responsible for saving the picture with the document.</p>
  
  <p>However, both these approaches look more or less the same in the end result: They work fine for me but won't work if they are executed on my friends pc with Excel 2013. So what I need is a work-around for the newer Excel versions (I read somewhere that from Excel 2010 upwards, there is a bug or something like that with these image import methods).</p>