Adding an Image to Footer

smit3446

New Member
Joined
Nov 16, 2015
Messages
46
We work with a lot of workbooks with multiple tabs that contain dated information, tab name, etc. in the header/footer and I want to create a way to automate the updating of the header/footers of these workbooks every year. I'm having a problem adding a picture to the footer, the rest of the code seems to work fine. Here is the code:

Code:
Sub header_footer_unscale_new()Dim ws As Worksheet




For Each ws In ActiveWorkbook.Worksheets
   
    With ws.PageSetup
        .ScaleWithDocHeaderFooter = False
        .TopMargin = Application.InchesToPoints(0.9)
        .LeftHeader = "&B&""Arial Narrow""&08&K04+000Company Name" & vbCr & "Program Name" & vbCr & "Effective Date"
        .RightHeader = ActiveSheet.Name
        '.RightFooterPicture = "&G" 'specifies that you want an image in your footer
        .RightFooterPicture.Filename = "H:\Templates\Excel Logo.jpg" 'specifies the image file
        
    End With
    ActiveWindow.View = xlNormalView
    Range("A1").Activate
    
Next
            
End Sub

I keep receiving the "Run-time error '1004': Application-defined or object-defined error" message once I run this code. I have tried with and without the "&G" declaration while receiving the same error.

Any suggestions are greatly appreciate, thank you!
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top