Image en pied de page via macro VBA

Bonjour à tous

Je recherche une macro VBA qui permettrait de mettre en pieds de page pour tous les onglets d'un classeur une image prise sur le Web.

J'ai trouvé des macros pour la page active mais déjà celles -ci ne marchent pas ;( : Cf. fichier joint.

Petite précision je n'y connais rien en VBA et suis sur Excel 2016.

Merci de vos réponses

Bonjour,

voici un exemple,

Sub InsertPicture()
image = "C:\Users\isabelle\Pictures\cachalot 1.jpg"

 For Each f In Worksheets
    With f.PageSetup.LeftFooterPicture
        .Filename = image
        .Height = 275.25
        .Width = 463.5
        .Brightness = 0.36
        .ColorType = msoPictureAutomatic
        .Contrast = 0.39
        .CropBottom = -14.4
        .CropLeft = -28.8
        .CropRight = -14.4
        .CropTop = 21.6
    End With

    f.PageSetup.LeftFooter = "&G"
Next f
End Sub

Bonjour

J'ai collé ton code dans mon onglet 3 et modifié le lien de la photo comme ceci :

Sub InsertPicture()
image = "https://i.stack.imgur.com/cdCSj.jpg"

 For Each f In Worksheets
    With f.PageSetup.LeftFooterPicture
        .Filename = image
        .Height = 275.25
        .Width = 463.5
        .Brightness = 0.36
        .ColorType = msoPictureAutomatic
        .Contrast = 0.39
        .CropBottom = -14.4
        .CropLeft = -28.8
        .CropRight = -14.4
        .CropTop = 21.6
    End With

    f.PageSetup.LeftFooter = "&G"
Next f
End Sub

Mais ça ne marche toujours pas ;(

Je ne comprends pas pourquoi ?????.

Bonjour,

Je pense qu'il faut au préalable enregistrer l'image sur son pc,

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
        "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _
        ByVal szFileName As String, ByVal dwReserved As Long, _
        ByVal lpfnCB As Long) As Long

Sub test()
Dim MonFichier As String
MonImage = "C:\Users\isabelle\Documents\Test1\monImage.jpg" à adapter
URLDownloadToFile 0, "https://i.stack.imgur.com/cdCSj.jpg", MonImage, 0, 0

For Each f In Worksheets
With f.PageSetup.LeftFooterPicture
.Filename = MonImage
.Height = 275.25
.Width = 463.5
.Brightness = 0.36
.ColorType = msoPictureAutomatic
.Contrast = 0.39
.CropBottom = -14.4
.CropLeft = -28.8
.CropRight = -14.4
.CropTop = 21.6
End With

f.PageSetup.LeftFooter = "&G"
Next f
End Sub
Rechercher des sujets similaires à "image pied page via macro vba"