Graphic Object [Excel 2003 VBA Language Reference]

PageSetup
Graphic

Contains properties that apply to header and footer picture objects.

Using the Graphic object

There are several properties of the PageSetup object that return the Graphic object.

Use the CenterFooterPicture , CenterHeaderPicture , LeftFooterPicture , LeftHeaderPicture , RightFooterPicture , or RightHeaderPicture properties to return a Graphic object.

The following example adds a picture titled: Sample.jpg from the C:\ drive to the left section of the footer. This example assumes that a file called Sample.jpg exists on the C:\ drive.

Sub InsertPicture()

    With ActiveSheet.PageSetup.LeftFooterPicture
        .FileName = "C:\Sample.jpg"
        .Height = 275.25
        .Width = 463.5
        .Brightness = 0.36
        .ColorType = msoPictureGrayscale
        .Contrast = 0.39
        .CropBottom = -14.4
        .CropLeft = -28.8
        .CropRight = -14.4
        .CropTop = 21.6
    End With

    ' Enable the image to show up in the left footer.
    ActiveSheet.PageSetup.LeftFooter = "&G"

End Sub

Note  It is required that "&G" is a part of the LeftFooter string in order for the image to show up in the left footer.

Properties | Application Property | Brightness Property | ColorType Property | Contrast Property | Creator Property | CropBottom Property | CropLeft Property | CropRight Property | CropTop Property | FileName Property | Height Property | LockAspectRatio Property | Parent Property | Width Property

Parent Objects | PageSetup Object

Child Objects