Extract Chart Titles from graphs

  • Thread starter Thread starter Excel Monkey
  • Start date Start date
E

Excel Monkey

I am looping through some chars in a workbook. I am trying to extract the
text from the Chart Titles. I cannot seem to get this to work using the
ChartTitle object and its Caption property. What am I doing wrong?


Dim chtobj As ChartObject

For Each chtobj In ActiveSheet.ChartObjects
Debug.Print chtobj.ChartTitle.Caption
Next

Thanks

EM
 
Try this

Sub Test()

Dim chtobj As Excel.ChartObject

For Each chtobj In ActiveSheet.ChartObjects
If chtobj.Chart.HasTitle Then
Debug.Print chtobj.Chart.ChartTitle.Text
End If
Next chtobj
End Sub


HTH,
Barb Reinhardt
 
Back
Top