I have recorded and amended the following code to print a chart that is embedded in a worksheet named 'Area Start'
Whne I previoew the print I get the following centre header text - "Area Start Chart 17rea Start"
I can't work out how this is happening and I only want the sheet name of 'Area Start' to be shown in the header.
Thanks
Code:
Sub PrintGraph()
Dim objChart As Object
For Each objChart In ActiveSheet.ChartObjects
With objChart.Chart
.PageSetup.Orientation = xlLandscape
.PageSetup.CenterHeader = "&""Arial,Bold""&36&" & ActiveSheet.Name
.PageSetup.LeftMargin = Application.InchesToPoints(0.393700787401575)
.PageSetup.RightMargin = Application.InchesToPoints(0.393700787401575)
.PageSetup.TopMargin = Application.InchesToPoints(1)
.PageSetup.BottomMargin = Application.InchesToPoints(0.590551181102362)
.PageSetup.HeaderMargin = Application.InchesToPoints(0)
.PageSetup.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PageSetup.FitToPagesWide = 1
.PageSetup.FitToPagesTall = 1
.PrintPreview
End With
objChart.Chart.PrintPreview
' objChart.Chart.PrintOut
Next objChart
End Sub
I can't work out how this is happening and I only want the sheet name of 'Area Start' to be shown in the header.
Thanks