A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I am not sure which version of Excel you are using, but after doing a little research, it looks like there are two ways to handle adding pictures within Excel 2007. I have modified my original code and have tested it on my 2007 environment. With this, I give you a caveat. All of the locally saved pictures should be in the same format (i.e. jpg, bmp, png, etc), and the ".jpg" portion of the code modified to match. Leaving off the extension does not appear to work properly for me and changing between format does not work without changing the code. Take a look at it and see if you can use it, or modify it to what you need.
[CODE]
Option Explicit
Private Sub Worksheet_Activate()
ActiveSheet.Pictures.Delete
On Error Resume Next
Dim cell As Range
For Each cell In Range("B7")
If InStr(1, cell, "/", 1) Then
Dim u As Variant
Dim p As Picture
u = Range("B7").Value
p = ActiveSheet.Pictures.Insert(u)
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.Top = Range("B7").Top
.Left = Range("B7").Left
.Height = 240
End With
Else
If InStr(1, cell, "", 1) Then
Dim strPicName As String
strPicName = Range("B7").Value
With ActiveSheet.Pictures.Insert(strPicName & ".jpg")
.Left = Range("B7").Left
.Top = Range("B7").Top
.ShapeRange.LockAspectRatio = msoTrue
.ShapeRange.Height = 240
End With
End If
End If
Next
End Sub
[/CODE]