Option
Explicit
Sub
Example()
Dim
shp
As
Shape
Dim
strFilename
As
String
With
Worksheets(
"Daten"
)
strFilename =
"c:\Bilder\" & .Cells(i, "
J
").Value & "
.jpg"
Set
shp = CreatePictureAtCellPos(strFilename, .Range(3,
"C"
), 100, 100)
End
With
End
Sub
Public
Function
CreatePictureAtCellPos( _
Filename
As
String
, Cell
As
Excel.Range, _
Width
As
Single
, Height
As
Single
_
)
As
Shape
Set
CreatePictureAtCellPos = Cell.Worksheet.Shapes.AddPicture( _
Filename, _
LinkToFile:=
True
, _
SaveWithDocument:=
False
, _
Left:=Cell.Left, _
Top:=Cell.Top, _
Width:=Width, _
Height:=Height)
End
Function