Private Sub CommandButton1_Click()
deImageAFeuille Me.Image1, ActiveSheet, "6", "13"
' changer le nombre (6), qui fait référence à la ligne et le nombre (13) qui fait référence à la colonne, par des données quand il doit être stocké dans la feuille de calcul
End Sub
Private Sub deImageAFeuille(monImage, sht As Worksheet, r As Integer, c As Integer)
Dim pic As String, L As Double, T As Double, H As Double, W As Double
Dim Sh As Shape
pic = ThisWorkbook.Path & "\" & Format(Now, "yymmdd hhmmss") & "bmp"
SavePicture monImage.Picture, pic
For Each Sh In sht.Cells(r, c).Parent.Shapes
If Sh.Name = pic _
Or (Sh.Top = sht.Cells(r, c).Top And Sh.Left = sht.Cells(r, c).Left) Then Sh.Delete
Next Sh
L = sht.Cells(r, c).Left: T = sht.Cells(r, c).Top
H = sht.Cells(r, c).Height: W = sht.Cells(r, c).Width
With sht.Shapes.AddPicture(FileName:=pic, linktofile:=msoFalse, savewithdocument:=msoCTrue, Left:=L, Top:=T, Width:=W, Height:=H)
.Placement = xlMove
.OLEFormat.Object.PrintObject = msoTrue
.OLEFormat.Object.Locked = msoTrue
End With
Kill pic