SkipVought
Programmer
VB Help is scant on this.
I am trying to manipulate the Series Interior Color on MS Graphs in a Power Point application for Pie, Bar and Line charts. (see thread707-612936)
On the Line Chart Series I get an error on assigning the interior color. I can set Marker Back/Fore colors. What magic can I conger from my fellow VBA wizards.
Here's my code so far...
Skip,
Skip@TheOfficeExperts.com
I am trying to manipulate the Series Interior Color on MS Graphs in a Power Point application for Pie, Bar and Line charts. (see thread707-612936)
On the Line Chart Series I get an error on assigning the interior color. I can set Marker Back/Fore colors. What magic can I conger from my fellow VBA wizards.
Here's my code so far...
Code:
Sub atest()
Dim sl As Slide, sh As Shape, ch As Chart, s As Series, p As Point
For Each sl In ActivePresentation.Slides
For Each sh In sl.Shapes
If sh.Type = msoEmbeddedOLEObject Then
i = 1
Set ch = sh.OLEFormat.Object
Select Case ch.ChartType
Case xl3DPie
For Each s In ch.SeriesCollection
j = 1
For Each p In s.Points
Select Case j
Case 1
p.Interior.Color = RGB(0, 0, 255)
Case 2
p.Interior.Color = RGB(0, 255, 0)
Case 3
p.Interior.Color = RGB(255, 0, 0)
End Select
j = j + 1
Next
i = i + 1
Next
Case xl3DBarClustered
For Each s In ch.SeriesCollection
Select Case i
Case 1
s.Interior.Color = RGB(0, 34, 76)
Case 2
s.Interior.Color = RGB(174, 188, 158)
Case 3
s.Interior.Color = RGB(111, 150, 201)
End Select
i = i + 1
Next
Case xlLineMarkers
For Each s In ch.SeriesCollection
Select Case i
Case 1
s.Fill.Color = RGB(0, 34, 76)
Case 2
s.Interior.Color = RGB(174, 188, 158)
Case 3
s.MarkerBackgroundColor = RGB(111, 150, 201)
End Select
i = i + 1
Next
End Select
End If
Next
Next
Set ch = Nothing
End Sub
Skip,
Skip@TheOfficeExperts.com