S
Steve
Hello everybody,
I am trying to set the range of cells to be used for an errorbar of
the 'customtype'. The range that I want to be used changes every time
I work on a different set of data.
This is basically what I want to do:
'******** Beginning of code *******
With Application.Workbooks("Auswerter.xls").Worksheets("data")
Set xrng = .Range(.Cells(2, fraction_row + 1), .Cells(merge_end -
1, fraction_row + 1))
Set yrng = .Range(.Cells(2, fraction_row + 2), .Cells(merge_end -
1, fraction_row + 2))
Set errrng = .Range(.Cells(2, fraction_row + 3), .Cells(merge_end
- 1, fraction_row + 3))
End With
Application.Workbooks("Auswerter.xls").Charts(2).SeriesCollection.NewSeries
With Application.Workbooks("Auswerter.xls").Charts(2)
.SeriesCollection(1).XValues = xrng
.SeriesCollection(1).Values = yrng
.errorbar Direction:=xlX, Include:=xlBoth,
Type:=xlErrorBarTypeCustom, Amount:=errrng minusValues:=errrng 'this
line generates the error
End With
'******* End of code *******
This gives an error 438: "Object doesn't suppoert this property or
method"
Setting it to the same range manually works, so there should not be a
problem with the values in the cells, but I guess it is rather the
usage of a range variable for amount and minusValues.
I already looked all over google, but cannot find a clue why this
error comes up or how I can get rid of it.
Would be great if someone could help me!
Thanks!
Steve
I am trying to set the range of cells to be used for an errorbar of
the 'customtype'. The range that I want to be used changes every time
I work on a different set of data.
This is basically what I want to do:
'******** Beginning of code *******
With Application.Workbooks("Auswerter.xls").Worksheets("data")
Set xrng = .Range(.Cells(2, fraction_row + 1), .Cells(merge_end -
1, fraction_row + 1))
Set yrng = .Range(.Cells(2, fraction_row + 2), .Cells(merge_end -
1, fraction_row + 2))
Set errrng = .Range(.Cells(2, fraction_row + 3), .Cells(merge_end
- 1, fraction_row + 3))
End With
Application.Workbooks("Auswerter.xls").Charts(2).SeriesCollection.NewSeries
With Application.Workbooks("Auswerter.xls").Charts(2)
.SeriesCollection(1).XValues = xrng
.SeriesCollection(1).Values = yrng
.errorbar Direction:=xlX, Include:=xlBoth,
Type:=xlErrorBarTypeCustom, Amount:=errrng minusValues:=errrng 'this
line generates the error
End With
'******* End of code *******
This gives an error 438: "Object doesn't suppoert this property or
method"
Setting it to the same range manually works, so there should not be a
problem with the values in the cells, but I guess it is rather the
usage of a range variable for amount and minusValues.
I already looked all over google, but cannot find a clue why this
error comes up or how I can get rid of it.
Would be great if someone could help me!
Thanks!
Steve