title: How to get Shape's internal name in Excel
body: <p>When a picture is inserted into an Excel worksheet using Shapes.AddPicture(...) method, Excel gives it a name "Picture 1", "Picture 2" etc automatically.</p>
  
  <p>This name can be used to get a reference to this shape object in Shapes collection like Shapes.Item("Picture 1"). If the name is changed in Excel using the Name Box, there are two different names (or one of them is a key/Caption) through which the Shape object can be referenced. So if I change the name to "MyPic" I can use any of these to reference a shape in Shapes collection:</p>
  
  <pre><code>Shapes.Item("Picture 1")
  OR
  Shapes.Item("MyPic")
  </code></pre>
  
  <p>The name can be accessed using Shape.Name property in VBA but how can we access the other value (MyPic) that does not seem to change internally?</p>
  
  <p><strong>UPDATED</strong><br>
  What I am trying to do is to link a cell to a picture in Excel. I keep the picture data in cell's comment. These are the scenarios:  </p>
  
  <ol>
  <li>If I keep the picture name (external name) then copy-pasting the structure on the same worksheet will duplicate the name and the cell will point to the same structure.</li>
  <li>If I keep the internal name then copy-pasting to other worksheet will create problem as the same internal name can exist on some other worksheet in the same workbook.</li>
  <li>If I take ID, I will not be able to get the Picture reference from it</li>
  </ol>
  
  <p>For me getting the internal name is important. I have the Shape reference but no idea how to get the internal name from this ref.</p>