Salut à tous
voici le résultat
j'ai modifié un peu ta proposition Patrick (sans copier l'image)
Function ImageShapeEnWMF(rng As Range) As String
'Convertir une image shape en image
Dim ImgTemp$, HandleClipImage&, retour&, shap As Shape
Application.CutCopyMode = False
With rng
.Comment.Visible = True
.Comment.Shape.CopyPicture
.Comment.Visible = False
End With
ImgTemp = VBA.Environ("userprofile") & "\DeskTop\a.wmf"
ExecuteExcel4Macro ("CALL(""user32"",""OpenClipboard"",""JJ""," & 0& & ")")
HandleClipImage = ExecuteExcel4Macro("CALL(""user32"",""GetClipboardData"",""JJ""," & 14 & ")") '2 pour bitmap,14 pour wmf
retour = ExecuteExcel4Macro("CALL(""gdi32"",""CopyEnhMetaFileA"",""JJC""," & HandleClipImage & ",""" & ImgTemp & """)")
ExecuteExcel4Macro ("CALL(""gdi32"",""DeleteEnhMetaFile"",""JJ""," & retour & ")")
ExecuteExcel4Macro ("CALL(""user32"",""CloseClipboard"",""J"")")
ImageShapeEnWMF = ImgTemp
End Function