• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Align the Chart in PPT using VBA

Hi All,

I need a help in alining the chart's in the PPT slides.

Code:
Sheet2.Activate
Sheet2.ChartObjects(1).Copy
popt.ActivePresentation.Slides(4).shapes.PasteSpecial (ppPasteBitmap)
Sheet2.ChartObjects(2).Copy
popt.ActivePresentation.Slides(4).shapes.PasteSpecial (ppPasteBitmap)

In the above code I am activating a sheet and copying the two charts by to the newly created ppt slide. But, the charts are over lapping. I need the two charts to be placed in the top and bottom of the slide.

Can any one please help me do this.

Regards,
Sakthisanthanam
 
Hi,

Try..
' Align pasted chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True


' Position pasted chart
PPApp.ActiveWindow.Selection.ShapeRange.Left = 100
PPApp.ActiveWindow.Selection.ShapeRange.Top = 50

I got it from this link:
http://peltiertech.com/Excel/XL_PPT.html#chartppt

Hope it helps.

Regards,
Prasad DN
 
Back
Top