dpiano1984
New Member
- Joined
- Feb 8, 2013
- Messages
- 14
I'm automating a chart to make errorbars, however when I create the Errorbar the weight does not change, even though I specify the weight. Here is my code:
Code:
Set s = .SeriesCollection.NewSeries() With s
.Name = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Activity").Range.Column) & "$" & sourceRow
.XValues = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("DateMid").Range.Column) & "$" & sourceRow
.Values = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Loc1").Range.Column) & "$" & sourceRow
.MarkerStyle = xlMarkerStyleNone
.HasErrorBars = True
.ErrorBar Direction:=xlX, Include:=xlErrorBarIncludeBoth, Type:=xlErrorBarTypeCustom, Amount:="=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("BarLength").Range.Column) & "$" & sourceRow, MinusValues:="=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("BarLength").Range.Column) & "$" & sourceRow
Set eB = .ErrorBars
With eB
With .Format.Line
.Style = msoLineSingle
.BackColor.RGB = gs.Range(getColumn(objList.ListColumns.Item("Color").Range.Column) & sourceRow).Interior.Color
.Weight = 12
.ForeColor.RGB = gs.Range(getColumn(objList.ListColumns.Item("Color").Range.Column) & sourceRow).Interior.Color
End With
.EndStyle = xlNoCap
End With
.HasDataLabels = True
Set dLabels = .DataLabels
With dLabels
.Format.TextFrame2.TextRange.InsertChartField msoChartFieldRange, "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Activity").Range.Column) & "$" & sourceRow
.ShowRange = True
.ShowSeriesName = False
.ShowValue = False
End With
End With