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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top