title: Change chart font using VBA
body: <p>How do I change the font of an Excel chart using VBA?</p>
  
  <p>If I manually select the chart, and record a macro while I manually change the font name and size, I get the macro below. But when I immediately replay the macro, it throws a run-time error: "The specified value is out of range." So it looks like the macro recorder has a bug. Which means I can't figure out the code to change the font myself. </p>
  
  <pre><code>Sub Macro6()
  '
  ' Macro6 Macro
  '
  
  '
      With ActiveSheet.Shapes("Chart 1").TextFrame2.TextRange.Font
          .NameComplexScript = "Verdana"
          .NameFarEast = "Verdana"
          .Name = "Verdana"
      End With
      ActiveSheet.Shapes("Chart 1").TextFrame2.TextRange.Font.Size = 14
  End Sub
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/yM6ng.png" alt="enter image description here"></p>
  
  <p>I know that as an alternative, I could change the font of each individual element one at a time (title, axis titles, axes, ...) but this is tedious and leaves open the possibility of forgetting some elements (series point labels, trendline equations, ...). </p>
  
  <p>I'm looking to change the "default" font of the chart, such that all its elements will have that font. </p>