Afficher un message
Vieux 25/09/2004, 22h06   #2 (permalink)
michel
Guest
 
Messages: n/a
Par défaut Re: Importation d’image d’une page HTLM dans un fichier Exel

bonsoir Joelle

tu peux essayer


Sub InsereImage()
Dim Emplacement As Range
Dim image As Picture
Dim ShapeObj As Object

On Error GoTo fin

For Each ShapeObj In ActiveSheet.DrawingObjects ' boucle pour supprimer l'ancienne image
If ShapeObj.Name = "cible" Then ActiveSheet.Shapes("cible").Delete
Next ShapeObj

Set Emplacement = Range("A1:C10")
Emplacement.Select
Set image = _
ActiveSheet.Pictures.Insert("http://www.meteofrance.com/img/produits/sat/fr/vis_VL7357IKZAG.jpg") 'adapter le chemin et le format image
With image.ShapeRange
.Name = "cible" ' nommer l'image insérée ( pour la supprimer plus faclement ensuite )
.LockAspectRatio = msoFalse
.Height = Emplacement.Height
.Width = Emplacement.Width
End With

fin:
If Err = 1004 Then MsgBox " le fichier n'a pas été trouvé ."

End Sub


bonne soiree
MichelXld