text: Q:
  
  How can I populate an Excel cell with an image?
  
  I'm trying to insert an image into an excel worksheet.
  The code is simply:
  Function AddImage(path As String, filename As String)
      Dim file As String
      file = path + "/" + filename + ".png"
  
      ActiveSheet.Range("A1").Pictures.insert(file).Select
  End Function
  
  but this doesn't work. When I set a watch on file I can see that it contains a valid path to an image on my hard drive. 
  What do I need to do to populate a cell with an image?
  
  A:
  
  You cannot put pictures "in" a cell, only "over" it. All pictures "float" on the worksheet. You can position a picture over a cell by setting its Top and Left properties to the Top and Left of the cell. 
  Sub AddPicOverCell(path As String, filename As String, rngRangeForPicture As Range)
  With Application
  Dim StartingScreenUpdateing As Boolean
  Dim StartingEnabledEvent As Boolean
  Dim StartingCalculations As XlCalculation
  
  StartingScreenUpdateing = .ScreenUpdating
  StartingEnabledEvent = .EnableEvents
  StartingCalculations = .Calculation
  
      .ScreenUpdating = False
      .EnableEvents = False
      .Calculation = xlCalculationManual
  End With
  
  Dim Top As Single, Left As Single, Height As Single, Width As Single
  Dim file As String
  Dim ws As Worksheet
  
  file = path + "/" + filename + ".png"
  
  Top = rngRangeForPicture.Top
  Left = rngRangeForPicture.Left
  Height = rngRangeForPicture.Height
  Width = rngRangeForPicture.Width
  
  Set ws = rngRangeForPicture.Worksheet
  
  ws.Shapes.AddPicture file, msoCTrue, msoTrue, Left, Top, Width, Height
  
  With Application
      .ScreenUpdating = StartingScreenUpdateing
      .EnableEvents = StartingEnabledEvent
      .Calculation = StartingCalculations
  End With
  End Sub
  
  And then you would call it like: 
  AddPicOverCell "C:\", "Pic", ActiveSheet.Range("A1")
  
  NOTES: This will position and resize the image to the same size and position on the sheet as the Cell you  specify when calling the sub. This will insert the picture over the cell OR range you want the picture in. This could also be a range of cells like B5:G25 or as in my example a single cell like Range("A1") and the picture will cover all cells in the range. 
  
  