Voila un code trouver sur boisgontierjacques
Sub InsèreImageCommentaireCelluleActive()
nf = Application.GetOpenFilename("Fichiers jpg,*.jpg")
If nf = False Then Exit Sub
ech = Application.InputBox("Echelle?", Type:=1, Default:=1)
If ech = 0 Then Exit Sub
With ActiveCell
.ClearComments
.AddComment
.Comment.Shape.Fill.UserPicture nf
p = InStrRev(nf, "\")
repertoire = Left(nf, p)
fichier = Mid(nf, p + 1)
taille = TaillePixelsImage(repertoire, fichier)
.Comment.Shape.Height = Val(Split(taille, "x")(1))
.Comment.Shape.Width = Val(Split(taille, "x")(0))
.Comment.Shape.ScaleHeight ech, msoFalse, msoScaleFromTopLeft
.Comment.Shape.ScaleWidth ech, msoFalse, msoScaleFromTopLeft
End With
End Sub
Function TaillePixelsImage(repertoire, fichier)
Set myShell = CreateObject("Shell.Application")
Set myFolder = myShell.Namespace(repertoire)
Set myFile = myFolder.Items.Item(fichier)
TaillePixelsImage = myFolder.GetDetailsOf(myFile, 26)
End Function