PDA

View Full Version : ChartType property changes for no reason



musicgold
06-09-2011, 06:49 AM
Hi,

I am trying to loop through all the charts in a worksheet and use the chartype property to classify the charts.

I have noticed that after executing the the highlighted lines in the following code the charttype of a chart automatically changes to -4111, irrespective of if the chart is a line or bar chart. I am not sure what is happening.



ActiveSheet.ChartObjects(i).Activate

If ActiveChart.ChartType = xlLine Then

ActiveChart.PlotArea.Interior.PatternColorIndex = 2
ActiveChart.SeriesCollection(2).Border.ColorIndex = 25
ActiveChart.SeriesCollection(2).MarkerBackgroundColorIndex = xlNone
ActiveChart.SeriesCollection(2).MarkerForegroundColorIndex = xlNone

End If


Thanks.