PDA

View Full Version : Solved: VBA to position a chart on ppt



kevvukeka
04-10-2013, 09:41 AM
Hi All,

I have one chart on each slide of my presentation. except few for many of them I need to set the height, width and Horizontal and vertical postions.

As a beginner I could only write the below code. I just want to select each chart and run this code so that the setting are done. but when i run this code, the chart dissapears from the slide. Can somebody help whats wrong with the below code:

Sub chart()
With ActiveWindow.Selection.ShapeRange
.Height = 4.93
.Width = 9.68
.Left = 0.16
.Top = 1.96

End With
End Sub

John Wilson
04-10-2013, 11:14 AM
PowerPoint measures in POINTS since there are 72 points to 1 inch your chart dimensions are TINY

Have a look here (http://www.pptalchemy.co.uk/PowerPoint_cmToPoints.html) for help on Points

kevvukeka
04-12-2013, 12:59 AM
Thank you John.. I was able to modify my code. Its working now as per my requirement..