Change color scheme of MS Graph with VBA

  • Thread starter Thread starter Ingrid Makkinje
  • Start date Start date
I

Ingrid Makkinje

It seems that VBA does not allow to change color schemes or RGB values
in charts. I have found code in the MSDN library on Intranet and VBA
Graph help but it does not seem to work.

For changing RGB values I have tried this:

Sub changeseriecolor()
Set myChart = ActiveWindow.Selection.ShapeRange(1) _
..OLEFormat.Object.Application.chart
myChart.SeriesCollection(2).Interior.Color _
= RGB(Red:=2, Green:=110, Blue:=6)
End Sub


I hope someone can help me with one of the two problems mentioned
above??
Ingrid
 
Ingrid,
Search the goggle groups for archived postings. This has been tried before,
it does not work because Graph reverts to the closest palate color index and
does not adhere to the RGB value that is set. To work around this use a 1x1
pixel image of the color as a fill for the graph to get the desired color.
 
Back
Top