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

  • Thread starter Thread starter Jody
  • Start date Start date
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
 
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
 
Back
Top