I have a chart and I'm trying to use VBA to set the length of the error bars on one of the series.
If I manually select the chart the following line works:
However, I'm trying to automate it without manually selecting the chart.
I've tried modifying it to:
but it gives the error 'Object doesn't support this property or method'.
Can anyone point out where I'm going wrong?
If I manually select the chart the following line works:
Code:
ActiveChart.SeriesCollection("MySeries").ErrorBar Direction:=xlX, Include:=xlPlusValues, Type:=xlFixedValue, Amount:=1
I've tried modifying it to:
Code:
Sheets("MySheet").ChartObjects("MyChart").ActiveChart.SeriesCollection("MySeries").ErrorBar Direction:=xlX, Include:=xlPlusValues, Type:=xlFixedValue, Amount:=1
Can anyone point out where I'm going wrong?