title: VBA adding chart title
body: <p>I simply want to add a chart title to my chart using vba. I actually want to do it recursively for every chart in every sheet, but I can't even get 1 chart to work. Here is the code I have:</p>
  
  <pre><code>Dim chnam
  chnam = Left(ActiveSheet.Name, (Len(ActiveSheet.Name) - 9))
  With ActiveWorkbook.ActiveSheet.ActiveChart
      .HasTitle = True
      .ChartTitle = chnam
  End With
  </code></pre>
  
  <p>Here is my chart:</p>
  
  <p><img src="https://i.stack.imgur.com/RIKB5.png" alt="enter image description here"></p>
  
  <p>When I run my code, I get:</p>
  
  <pre><code>Object does not support this property or method
  </code></pre>