PDA

View Full Version : How to select charts in all slides and them make 100%



s_manojp
03-24-2009, 10:18 AM
For ex: In my ppt, there are almost 100 slides and in each slides there are 2-3 charts. If my select one chart and run the macro, all the charts from all the slides should become 100% and should be of same size.

Please help.

marathi.bana
03-25-2009, 11:11 AM
The following code will find all the MSGraph in the presentation and make them 100%

Sub Chart()
Dim oShp As Shape
Dim oSld As Slide
Dim x As Long
For Each oSld In ActivePresentation.Slides
For x = oSld.Shapes.Count To 1 Step -1
Set oShp = oSld.Shapes(x)
If oShp.Type = msoEmbeddedOLEObject Then
If InStr(oShp.OLEFormat.ProgID, "MSGraph") > 0 Then 'This is MSGraph
oShp.LockAspectRatio = msoTrue
oShp.ScaleHeight 1, msoTrue
oShp.ScaleWidth 1, msoTrue
End If
End If
Next
Next
End Sub