PDA

View Full Version : VBA: Update Size and Position of Each Chart for Each Slide in Slide Deck



nas8424
04-12-2018, 03:11 PM
Hi - I have a slide deck consistent of 100 Slides, and need all the Charts in the Slide Deck to all be the same size and position (so when we are flipping through it, we can see differences). I have googled the beginning for loop which cycles through each slide, but am having trouble with the position and size part. I can't figure out the name of each chart, but imagine they simply go from Chart1 to Chart100, anyway to create a loop that does this. Thanks




For Each SlideToCheck In ActivePresentation.Slides
For Each ShapeToCheck In SlideToCheck.Shapes
'Update Position and Size of each Chart
Next
Next

John Wilson
04-12-2018, 11:15 PM
For Each SlideToCheck In ActivePresentation.Slides For Each shapetocheck In SlideToCheck.Shapes
If shapetocheck.HasChart Then
With shapetocheck
.Left=??
.Top=??
.Width=??
.Height=??
End With
End If
Next
Next

?? is in POINTS 72 to the inch

nas8424
09-04-2018, 02:44 PM
I'm getting a RunTime error 429 - ActiveX component can't create object right at the beginning of this for-loop previously mentioned. I have Powerpoint 14.0 Active in the References; I'm using Excel 2010. Is there a compatible workaround? Thanks

John Wilson
09-05-2018, 09:17 AM
None of the posted code is creating an ActivX object so I guess there is earlier (faulty) code.

nas8424
09-05-2018, 08:09 PM
Would you happen to have the code that does this? Thanks