AW: Bilder per vba einen Platz zuweisen
01.02.2019 12:54:00
Nepumuk
Hallo Annika,
lagere das Einfügen in eine eigene Prozedur aus. Beispiel:
Private Sub InsertPicture( _
ByVal pvstrPicturePath As String, _
ByRef probjWorksheet As Worksheet, _
ByRef probjCell As Range)
Dim objShape As Shape
Set objShape = probjWorksheet.Shapes.AddPicture _
(Filename:=pvstrPicturePath, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=probjCell.Left, _
Top:=probjCell.Top, _
Width:=150, _
Height:=150)
objShape.Placement = xlMoveAndSize
Set objShape = Nothing
End Sub
Aufrufen kannst du die dann so:
Call InsertPicture(Pfad, Zelle, Tabelle)
Gruß
Nepumuk