Extracting Graph Title from Embedded MSGraph object

B

Barb Reinhardt

I have the following:

For j = 1 To .Shapes.Count
If .Shapes(j).Type = 7 Then
If .Shapes(j).OLEFormat.ProgID = "MSGraph.Chart.8" Then
Debug.Print "Found Chart icount = " & iCount & " j=" & j
End If
End If
Next j

How do I get the graph title, if it exists?
 
A

Andy Pope

Hi,

Try this addition,

For j = 1 To .Shapes.Count
If .Shapes(j).Type = 7 Then
If .Shapes(j).OLEFormat.ProgID = "MSGraph.Chart.8" Then
Debug.Print "Found Chart icount = " & _
icount & " j=" & j

If .Shapes(j).OLEFormat.Object. _
Application.chart.HasTitle Then
Debug.Print "Chart Title = ";
..Shapes(j).OLEFormat.Object. _
Application.chart.charttitle.Text
End If

End If
End If
Next j


Cheers
Andy
 
Top