Mets plutôt ta collection de cartes dans un dossier séparé
Ensuite, la fonction que je t'ai proposée et légèrement modifiée fonctionne
Option Explicit
Const deltaX = 10 ' horizontal
Const deltaY = 20 ' vertical
Const offsetX = 0
Const offsetY = 0
Function AfficherImage( _
ByVal image As String, _
Optional ByVal largeur As Long = 100, _
Optional ByVal hauteur As Long = 150, _
Optional ByVal texte As String = "") As Variant
Application.Volatile
Dim oImg As Shape, oRng As Range
Set oRng = Application.Caller.Offset(offsetY, offsetX)
On Error Resume Next
Set oImg = oRng.Parent.Shapes(Application.Caller.Address)
oImg.Delete
On Error GoTo 0
If image = "" Then GoTo fin
On Error GoTo fin
Set oImg = oRng.Parent.Shapes.AddPicture(ThisWorkbook.Path & "\cartes\" & image & ".jpg", True, True, oRng.Left + deltaX, oRng.Top + deltaY, largeur, hauteur)
oImg.Name = Application.Caller.Address
AfficherImage = "ok"
Exit Function
fin:
AfficherImage = "pas d'image"
End Function
La macro fonctionne si la cellule est modifiée par une fonction Excel.