A
alldreams
Could anyone tell me why this macro breaks? I get
a "Method Charttype of object failed.
Sub Macro2()
Dim johann As ChartObject
Set johann = ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=615, Top:=18, Height:=410)
johann.Chart.ChartType = xlStockHLC
johann.Chart.SetSourceData Source:=Sheets
("DATA").Range("U4:CD6"), PlotBy:= _
xlRows
johann.Chart.SeriesCollection(1).XValues = "=DATA!
R3C21:R3C82"
johann.Chart.SeriesCollection(1).Values = "=DATA!
R4C21:R4C82"
johann.Chart.SeriesCollection(2).XValues = "=DATA!
R3C21:R3C82"
johann.Chart.SeriesCollection(3).XValues = "=DATA!
R3C21:R3C82"
johann.Chart.Location Where:=xlLocationAsObject,
Name:="DATA"
End Sub
thanks for your help!
a "Method Charttype of object failed.
Sub Macro2()
Dim johann As ChartObject
Set johann = ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=615, Top:=18, Height:=410)
johann.Chart.ChartType = xlStockHLC
johann.Chart.SetSourceData Source:=Sheets
("DATA").Range("U4:CD6"), PlotBy:= _
xlRows
johann.Chart.SeriesCollection(1).XValues = "=DATA!
R3C21:R3C82"
johann.Chart.SeriesCollection(1).Values = "=DATA!
R4C21:R4C82"
johann.Chart.SeriesCollection(2).XValues = "=DATA!
R3C21:R3C82"
johann.Chart.SeriesCollection(3).XValues = "=DATA!
R3C21:R3C82"
johann.Chart.Location Where:=xlLocationAsObject,
Name:="DATA"
End Sub
thanks for your help!