D
djf
I want to set the colors in a pie chart to the same colors everytime it runs.
I've tried recording an Excel macro and then converting it to Access but
could not get it to work. I've searched for VBA to do it and I've found code
like this:
With Me.ChartSpace.Charts(0)
.SeriesCollection(1).Interior.Color = RGB(255, 128, 128) 'peach
.SeriesCollection(2).Interior.Color = RGB(0, 255, 128) 'green
.SeriesCollection(3).Interior.Color = RGB(0, 128, 255) 'blue
.SeriesCollection(4).Interior.Color = RGB(128, 255, 255) 'turquoise
.SeriesCollection(5).Interior.Color = RGB(255, 255, 128) 'yellow
.SeriesCollection(0).Interior.Color = RGB(255, 0, 255) 'magenta
End With
I played with the code and got it to use the first color but it changed all
pie wedges to the same color and then errored out when it went to the next
series collection.
Does anyone know the VBA to set the colors?
I've tried recording an Excel macro and then converting it to Access but
could not get it to work. I've searched for VBA to do it and I've found code
like this:
With Me.ChartSpace.Charts(0)
.SeriesCollection(1).Interior.Color = RGB(255, 128, 128) 'peach
.SeriesCollection(2).Interior.Color = RGB(0, 255, 128) 'green
.SeriesCollection(3).Interior.Color = RGB(0, 128, 255) 'blue
.SeriesCollection(4).Interior.Color = RGB(128, 255, 255) 'turquoise
.SeriesCollection(5).Interior.Color = RGB(255, 255, 128) 'yellow
.SeriesCollection(0).Interior.Color = RGB(255, 0, 255) 'magenta
End With
I played with the code and got it to use the first color but it changed all
pie wedges to the same color and then errored out when it went to the next
series collection.
Does anyone know the VBA to set the colors?