Hi
I have a procedure in Excel 2007 VBA that formats the colours of the lines on an XY Scatter graph according to the number of series in the graph.
The part that I'm having trouble with is:
With oSeries.Format.Line
.ForeColor.ObjectThemeColor = rngColours.Cells(x, intSeries).Interior.ThemeColor
.ForeColor.TintAndShade = rngColours.Cells(x, intSeries).Interior.TintAndShade
End With
Where rngColours is a range of cells in a worksheet in the same document with the interior filled with the desired colour and shade, x is an integer which represents the number of the current series and intSeries is an integer representing the number of series in the chart.
The code works fine for all line graphs but when I try to apply it to the lines on an XY Scatter it only changes the border of the points and not the line connecting the points.
Similarly putting the code below in the immediate window gives the same results:
ActiveChart.SeriesCollection(1).Format.Line.ForeColor.ObjectThemecolor = 2
The final point in the puzzle is that when I run this in Excel 2010 it works without any problems.
Has anyone come across this and have any suggestions for solving it?
Thanks