Printing Embedded chart

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,624
Office Version
  1. 365
Platform
  1. Windows
I have recorded and amended the following code to print a chart that is embedded in a worksheet named 'Area Start'
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
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
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,222,631
Messages
6,167,194
Members
452,104
Latest member
jadethejade

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