Change color scheme of MS Graph with VBA

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
 
S

Shyam Pillai

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top