Alors oui le fichier est bien dans le répertoire contenant les images
Alors il me semble que l'on peut faire plus simple..
essayez avec ce code :
Sub insert_img_excel()
Dim Limg, Himg As Integer, i As Integer, dl As Integer
Dim fileAccessGranted As Boolean
Dim filePermissionCandidates
Dim Photo
Limg = Range("F1").Value
Himg = Range("H1").Value
Application.ScreenUpdating = False
With ActiveSheet
dl = .Cells(.Rows.Count, "Y").End(xlUp).Row 'derni?re ligne non vide en Y
'Autorisation aux fichiers image ----------------------------------
filePermissionCandidates = Array(Application.ThisWorkbook.Path & "/")
fileAccessGranted = GrantAccessToMultipleFiles(filePermissionCandidates)
'insertion des images et dimensionnement ---------------------------
For i = 3 To dl
With .Cells(i, "Z") 'avec Z
.RowHeight = Himg 'ajuste hauteur ligne
imgLeft = .Left 'stocke position gauche de cellules
imgTop = .Top 'stock position haute
imgWidth = Limg 'larg col
imgHeight = Himg 'haut lignes
End With
On Error Resume Next 'eviter erreur si image non trouvee
With .Cells(i, "Z") 'avec Z
.RowHeight = Himg 'ajuste hauteur ligne
imgLeft = .Left 'stocke position gauche de cellules
imgTop = .Top 'stock position haute
imgWidth = Limg 'larg col
imgHeight = Himg 'haut lignes
End With
Photo = ThisWorkbook.Path & "/" & .Range("X" & i)
With .Shapes.AddPicture(Photo, msoFalse, msoTrue, imgLeft, imgTop, imgWidth, imgHeight) 'ajoute image (renvoie objet shape)
.Name = Replace(item, ".jpg", "") & i 'modifie nom (sans ".jpg")
.Placement = xlMoveAndSize 'pour verouiller l'image a la cellule
End With
On Error GoTo 0
Next i
End With
Application.ScreenUpdating = True
End Sub