Hi guys,
I'm having difficulty inserting a logo in my Header using a macro.
I've pasted the code below:
After I've saved the macro and try to run it in a spreadsheet, the logo doesn't load. Instead I see &R.
I also inserted a page number into the macro as well but that doesn't load either. I'm using excel 2010.
I'm running the exact same macro on another computer running excel 2013 and that works perfectly.
Can anybody shed some light on this issue?
Thanks a lot,
Amit
I'm having difficulty inserting a logo in my Header using a macro.
I've pasted the code below:
Code:
Sub Logo()
'
' Logo Macro
'
' Keyboard Shortcut: Ctrl+Shift+B
'
ActiveWindow.View = xlPageLayoutView
ActiveSheet.PageSetup.CenterHeaderPicture.Filename = _
"C:\Users\NEW\Documents\Absolute Solutions\Checkpoint\Admin\LOGOS\Absolute Logo Macro.png"
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&G"
.RightHeader = "&P"
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Range("A1:F1").Select
End Sub
I also inserted a page number into the macro as well but that doesn't load either. I'm using excel 2010.
I'm running the exact same macro on another computer running excel 2013 and that works perfectly.
Can anybody shed some light on this issue?
Thanks a lot,
Amit
Last edited by a moderator: