AW: In Masse Bilder importieren
29.09.2020 09:56:10
Nepumuk
Hallo Dennis,
teste mal:
Option Explicit
Public Sub InsertPictures()
Dim strPath As String, strFileName As String
Dim lngRow As Long
Dim objShape As Shape
For lngRow = 2 To Cells(Rows.Count, 1).End(xlUp).Row
With Cells(lngRow, 1)
If Dir$(.Text) <> vbNullString Then
Set objShape = ActiveSheet.Shapes.AddPicture(Filename:=.Text, LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, Left:=.Offset(0, 1).Left, Top:=.Top, Width:=-1, Height:=-1)
Else
.Offset(0, 1).Value = "Bild nicht gefunden"
End If
End With
Next
Set objShape = Nothing
End Sub
Gruß
Nepumuk