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
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