Image commentaire en VBA

damien57

XLDnaute Nouveau
Bonjour à tous,

Je souhaiterais créer dans VBA un programme permettant à l'utilisateur de choisir une cellule dans excel en cliquant dessus puis d'insérer un commentaire comprenant une image. Biensur l'utiilisateur doit pouvoir choisir l'image dans un dossier.

Etant novice en programmation VBA, j'ai essayé de créer une macro manuellement c'est à dire en enregistrant les manip à réaliser manuellement pour insérer une image dans un commentaire.

Voial ce que ça me donne :

Sub Macro1()




Range("A15").AddComment
Range("A15").Comment.Visible = False
Range("A15").Comment.Text Text:="" & Chr(10) & ""
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.BackColor.SchemeColor = 80
Selection.ShapeRange.Fill.UserPicture _
"C:\Documents and Settings\DSCN1888.JPG"
End Sub


Malheureusement je n'arrive pas à exploiter ce programme..Please Help!!!


Merci
 

Statistiques des forums

Discussions
312 316
Messages
2 087 185
Membres
103 491
dernier inscrit
bilg1