salut si tu peux appliquer ce exemple
Photos en commentaire à la saisie
Ajoute des photos en commentaire dans les cellules de la colonne A dès la saisie
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Count = 1 Then
répertoirePhoto = "c:\photos\" ' adapter
ech = 1
Target.ClearComments
nf = répertoirePhoto & Target & ".jpg"
If Dir(nf) <> "" Then
Target.AddComment
Target.Comment.Text Text:=CStr(Target.Value)
Target.Comment.Visible = True
Target.Comment.Shape.Fill.UserPicture nf
Set myShell = CreateObject("Shell.Application")
Set myFolder = myShell.Namespace(répertoirePhoto)
Set myFile = myFolder.Items.Item(Target & ".jpg")
Taille = myFolder.GetDetailsOf(myFile, 26)
Target.Comment.Shape.Height = Val(Split(Taille, "x")(1))
Target.Comment.Shape.Width = Val(Split(Taille, "x")(0))
Target.Comment.Shape.ScaleHeight ech, msoFalse, msoScaleFromTopLeft
Target.Comment.Shape.ScaleWidth ech, msoFalse, msoScaleFromTopLeft
Target.Comment.Visible = False
End If
End If
End Sub