Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSGraph Powerpoint VBA

Status
Not open for further replies.

tgmoon

Technical User
Jan 31, 2001
54
GB
Hi. I'm trying to create a graph in powerpoint with VBA which will then apply the format required. A basic version below:-

Sub GraphTest()
Dim oShape As PowerPoint.Shape
Dim oGraphChart As Graph.Application

Set oShape = ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject _
(Left:=120#, Top:=110#, Width:=480#, Height:=320#, _
ClassName:="MSGraph.Chart.8", Link:=msoFalse)

oShape.OLEFormat.Activate
Set oGraphChart = oShape.OLEFormat.Object.Application
With oGraphChart
.Chart.ChartType = xlColumnStacked
.Chart.ChartArea.Font.Size = 8
.Update
.Quit
End With
Set oShape = Nothing
Set oGraphChart = Nothing
End Sub

What i would like to be able to do is also change the standard colors in the chart options, as if one were manually selecting "tools" "Options" then "colors". I know it can be done in Excel but i'm not sure how to translate it for Powerpoint.

many thanks

Thom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top