1
votes

I have several Powerpoint presentations, with over a hundred slides in each, and at least half of them contain charts..

The problem is, I was tasked with modifying the 3-d formatting for every chart, in a way that I have to modify e-v-e-r-y series in e-v-e-r-y chart, in at least 50 slides, multiply it by 4 presentations [so far..]. It took me a little over an hour to set the "Top bevel-> Width" in one series, and then select the next one and press F4 to re-apply.. And then to repeat the whole process with the Height settings. The client has different types and coloring of the charts [each category in the presentation has its own theme].

Is there a quick way, a few lines of code that can force that 3-d formatting for all the charts?

1
The few lines of code go like this: For each file, open file, for each slide, if contains chart, modify chart, next slide, save file.Tomalak
You can use the macro recorder (enable the developer tab on the ribbon) to figure out the key elements of the "modify chart" part, but you won't get around modifying the code that the macro recorder produces and reading a lot of documentation.Tomalak
I'm such a noob, how do I mark it as solved?haneen
Your solution is not messy at all! To the contrary, it's pretty much perfect. Nicely done! You can mark this as solved by moving the code from the question into an answer - answering your own questions is fine on this site.Tomalak

1 Answers

0
votes

Solution by OP.

Sub THREEEE()
  Dim slide As Object
  Dim shape As Object
  Dim shapeNames As Object
  Dim srs As Series
  Dim bigSrs As SeriesCollection

  Dim i As Integer
  Dim j As Integer

      For Each slide In ActivePresentation.Slides
          For Each shape In slide.Shapes
              If shape.HasChart Then
                j = shape.Chart.SeriesCollection.Count
                For i = 1 To j
                    Set srs = shape.Chart.SeriesCollection(i)
                    With srs
                        .Format.ThreeD.BevelTopType = msoBevelCircle
                        .Format.ThreeD.BevelTopInset = 15
                        .Format.ThreeD.BevelTopDepth = 3  
                     End With
                Next i        
              End If
          Next
      Next
    End Sub