Consulting

Results 1 to 5 of 5

Thread: VBA: Update Size and Position of Each Chart for Each Slide in Slide Deck

  1. #1
    VBAX Regular
    Joined
    Apr 2018
    Posts
    6
    Location

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

    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
    

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Apr 2018
    Posts
    6
    Location
    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

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    None of the posted code is creating an ActivX object so I guess there is earlier (faulty) code.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Regular
    Joined
    Apr 2018
    Posts
    6
    Location
    Would you happen to have the code that does this? Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •