title: Way to tell if ActiveSheet.Pictures.Insert(Filename).Select Fails?
body: <p>I have made an excel macro for my company that mass inserts images in a picture folder by their cell value.</p>
  
  <p>The <code>cell.Value</code> contains the SKU number, so I add the rest of the file path in a <code>for each loop</code> and then use <code>ActiveSheet.Pictures.Insert(Filename).Select</code>.</p>
  
  <p>Everything works great, but when files are not found within the picture folder, the filepath is left in the cell. I would like to change all cells that don't find an image to say "No Image" rather than the filepath.</p>
  
  <p>Is there anyway to test if <code>ActiveSheet.Pictures.Insert(Filename).Select</code> failed to find an image, then I could rewrite the cell.Value if it failed?</p>
  
  <p>I've tried to add another For each loop to see if the cell.Value has contents in it. This is because the insert image portion runs a cell.ClearContents once it's done so all the cells with images inserted don't have their SKU numbers behind the image. I'm having trouble with this process as well and would like to avoid for eaching through the selection twice.</p>
  
  <pre><code>Option Explicit
  Dim rng As Range
  Dim cell As Range
  Dim Filename As String
  Sub PictureImport()
  
  
  
  Set rng = ActiveSheet.Range("A2:A3000")
  For Each cell In Selection '&lt;-- *For Each cell In rng* For Hard Coded selection
  If cell.Value &lt;&gt; "" Then cell.Value = "\\Pictures\" &amp; cell.Value &amp; ".jpg" '&lt;---NEEDS TO SKIP HEADER
  Next
  
      Dim theShape As Shape
      Dim xRg As Range
      Dim xCol As Long
      On Error Resume Next
      Application.ScreenUpdating = False
      Set rng = ActiveSheet.Range("A2:A3000")   ' &lt;---- CHANGE TO START AT A2 TO SKIP HEADER
      For Each cell In Selection
          Filename = cell
          If InStr(UCase(Filename), "JPG") &gt; 0 Then   '&lt;--- ONLY USES JPG'S
              ActiveSheet.Pictures.Insert(Filename).Select
              Set theShape = Selection.ShapeRange.Item(1)
              If theShape Is Nothing Then GoTo isnill
              xCol = cell.Column
              Set xRg = Cells(cell.Row, xCol)
              With theShape
                  .LockAspectRatio = msoFalse
              ' Shape position and sizes stuck to cell shape
                  .Top = cell.Top + 1
                  .Left = cell.Left + 1
                  .Height = cell.Height - 2
                  .Width = cell.Width - 2
              ' Move with the cell (and size, though that is likely buggy)
              .Placement = xlMoveAndSize
              End With
  
              cell.ClearContents
  
  isnill:
              Set theShape = Nothing
              Range("A2").Select
          End If
      Next
  
      Debug.Print "Done " &amp; Now
  
      Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>Actual Results as stands: Images in the pictures folder will be inserted to the size of the cell, but will leave the cells that could not find a picture with the file path still in the the cell value.</p>