VBA syntax for moving legend in Excel Chart embedded in PowerPoint 97

J

Jody

Hello! I am trying to write a routine that will change
the location of the legend for EVERY embedded Excel chart
that is part of a Powerpoint file. I have the syntax now
that will scroll through all the shapes and determine if
the shape is an Excel Chart. Now I just need the one line
of code (I think it would be one line) to change the
location of the legend. Can you help???

Thanks, Jody

Here is the code I have (thanks to this board):

Dim oSl As Slide
Dim oShapes As Shapes
Dim oSh As Shape

For Each oSl In ActivePresentation.Slides
Set oShapes = oSl.Shapes
For Each oSh In oShapes
If UCase(Mid$(oSh.OLEFormat.ProgID, 1, 11))
= "EXCEL.CHART" Then
'THIS IS WHERE I NEED TO CHANGE THE LOCATION
OF THE CHART'S LEGEND
End If
Next oSh
Next oSl
 
S

Shyam Pillai

Jody,

' ----- Beginning Of Code -----
' Assuming oExcelChart contains reference to the embedded Excel Chart.
With oExcelChart
If .HasTitle Then
With .ChartTitle
.Left = 0
.Top = 0
End With
End If
End With
' ----- End Of Code -----

--
Regards
Shyam Pillai

Image Importer Wizard
http://www.mvps.org/skp/iiw.htm
 

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