Sub InsertionImage()
Dim Emplacement As Range
Dim image As Object
Dim ShapeObj As Object
ActiveSheet.Unprotect ("mdp")
On Error GoTo fin:
For Each ShapeObj In ActiveSheet.DrawingObjects ' boucle pour supprimer ancienne image
If ShapeObj.Name = "cible" Then ActiveSheet.Shapes("cible").Delete
Next ShapeObj
Application.Dialogs(xlDialogInsertPicture).Show
Set Emplacement = Range("N3:P6")
Set image = ActiveSheet.DrawingObjects 'adapter selon nombre total de shapes dans feuille
With image.ShapeRange
.Name = "cible" ' nommer l'image insérée ( pour la supprimer plus facilement ensuite )
.LockAspectRatio = msoFalse
.Left = Emplacement.Left
.Top = Emplacement.Top
.Height = Emplacement.Height
.Width = Emplacement.Width
End With
Exit Sub
fin:
If Err = 1004 Then MsgBox "Insertion d'image interrompue . "
ActiveSheet.Protect ("mdp")
End Sub