Bonjour Isabelle,
Je lui ai donn=E9 cette piste ci :
Une sub pour ins=E9rer l'image et surtout pour la nommer Largement inspir=
=E9e par MSDN
Une function "volatile" qui met =E0 jour l'image. Y a qu'a changer le chem=
in par une url.
Cdt
Blaise
Sub InsertionImage()
Dim Emplacement As Range
Dim Img As Object
Dim ShapeObj As Shape
=20
'Boucle pour supprimer l'ancienne image
For Each ShapeObj In ActiveSheet.Shapes
If ShapeObj.Name =3D "Cible" Then ActiveSheet.Shapes("Cible").Delet=
e
Next ShapeObj
=20
If Application.Dialogs(xlDialogInsertPicture).Show Then
'D=E9finit lthemplacement de l'image
Set Emplacement =3D Range("D3:E8")
=20
Set Img =3D ActiveSheet.DrawingObjects(ActiveSheet.Shapes.Count)
=20
With Img.ShapeRange
'Nommer l'image ins=E9r=E9e (Pour la supprimer plus facilement =
ensuite)
.Name =3D "Cible"
.LockAspectRatio =3D msoFalse
.Left =3D Emplacement.Left
.Top =3D Emplacement.Top
.Height =3D Emplacement.Height
.Width =3D Emplacement.Width
End With
=20
Else
MsgBox "Insertion d'image interrompue."
End If
=20
End Sub
Function Image_Volatile()
Application.Volatile
Dim Emplacement As Range
Dim Img As Object
Dim ShapeObj As Shape
Dim sNF As String
Dim rL As Single, rT As Single, rH As Single, rW As Single
'Boucle pour supprimer l'ancienne image
For Each ShapeObj In ActiveSheet.Shapes
If ShapeObj.Name =3D "Cible" Then
With ShapeObj
sNF =3D .AlternativeText
rL =3D .Left
rT =3D .Top
rW =3D .Width
rH =3D .Height
.Delete
End With
End If
Next ShapeObj
ActiveSheet.Shapes.AddPicture sNF, True, True, rL, rT, rW, rH
Set Img =3D ActiveSheet.DrawingObjects(ActiveSheet.Shapes.Count)
With Img.ShapeRange
'Nommer l'image ins=E9r=E9e (Pour la supprimer plus facilement ensu=
ite)
.Name =3D "Cible"
.LockAspectRatio =3D msoFalse
End With
End Function