View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arne Arne is offline
external usenet poster
 
Posts: 35
Default VBA chart formatting

How can I format individual serieslines within a chart group?

Why does this not change the LineStyles?

Set ChtSht = Worksheets("Sheet1")
Dim ChtObj As ChartObject


For Each ChtObj In ChtSht.ChartObjects

Debug.Print "Chart Object #: " & ChtObj.Index

ChtObj.Activate
Debug.Print "Number of Chart Groups is: " &
ActiveChart.ChartGroups.Count
'Debug.Print ChtObj.ChartGroups.Count 'object doesn't support property
or method

Debug.Print "Number of series is: " & ActiveChart.SeriesCollection.Count

ActiveChart.ChartGroups(1).HasSeriesLines = True

With ActiveChart.ChartGroups(1).SeriesLines.Border
.LineStyle = xlDashDotDot 'unable to set LineStyle property of Border
.Weight = xlMedium
.ColorIndex = 3
End With

Next ChtObj

The immediate widow:

Chart Object #: 1
Number of Chart Groups is: 1
Number of series is: 4