none
Recognize Chart inside Drawing Tools - Powepoint RRS feed

  • Question

  • Hi

    I have the following code which loops thru all shapes in PowerPoint presentation.

    The code loops thru all shapes and check if they are Chart. The problem is that some of the shapes are drawing tools and inside them there is a chart.

    How can I recoginze all charts including the charts inside the Drawing tool

    Sub test()
    
        Dim sld As Slide
        Dim shp As Shape
        Dim sr As Series
        Dim chrt As Chart
    
            For Each sld In ActivePresentation.Slides
                For Each shp In sld.Shapes
    
                    If shp.HasChart Then
                        Debug.Print shp.Chart.ChartType
    
                        If shp.Chart.ChartType = 57 Then
    
                            shp.Chart.SeriesCollection(1).DataLabels.Font.Color = RGB(0, 0, 0)
    
                         End If
    
                    End If
    
        Next shp
        Next sld
    
    End Sub


    Guy Zommer

    Thursday, June 30, 2016 8:54 AM

All replies

  • "Drawing Tools"? I don't understand what this means.

    I know in Excel that grouping shapes makes it trickier to find all charts, and I imagine it's the same in PowerPoint. The ones that are ungrouped ChartObjects are easy, but then you need to find any that are groups of shapes, and loop through the shapes in the group to find those charts. And if any of the shapes in the group are themselves a group of shapes, you need to check those.


    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services, Inc.
    Peltier Tech Blog

    Thursday, June 30, 2016 12:59 PM
  • Hi,

    I mean that some of the Charts are inside another Shape such as textbox and the previous code "ignores" those charts. How do I make a look to find all Charts inside the presentation


    Guy Zommer

    Thursday, June 30, 2016 1:05 PM
  • How do you get a chart inside another shape? You can group a chart with another shape, but not put it inside another shape.

    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services, Inc.
    Peltier Tech Blog

    Thursday, June 30, 2016 7:50 PM