Commentaire

Gexk5

XLDnaute Occasionnel
Bonsoir le forum,
Voici mon problème, j'ai recuperé ce code qui permet de commenter en automatique une celulle par une image, fichier excel et image dans le meme repertoire.
J'ai une erreur au moment des tailless!!!!
Quelqu'un a t il une idée du pourquoi du comment???

Peut on agrandir la taille du commentaire???


Sub CommentImages()
repertoire = ThisWorkbook.Path & "\"
For Each c In Range("A2", [A65000].End(xlUp))
c.ClearComments
c.AddComment
c.Comment.Text Text:=CStr(c)
fichier = CStr(c.Value) & ".jpg"
If Dir(repertoire & fichier) <> "" Then
c.Comment.Shape.Fill.UserPicture repertoire & fichier
taille = TaillePixelsImage(repertoire, fichier)
ici--c.Comment.Shape.Height = Val(Split(taille, "x")(-1))
ici--c.Comment.Shape.Width = Val(Split(taille, "x")(0))
c.Comment.Shape.ScaleHeight 0.5, msoFalse, msoScaleFromTopLeft
c.Comment.Shape.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
End If
Next
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

Merci de vos reponses
 

Statistiques des forums

Discussions
312 378
Messages
2 087 760
Membres
103 661
dernier inscrit
fcleves