zero80
04-04-2008, 12:26 PM
hi, my macro run with error (runtime error 1004)
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(1).Values = "='Detalle Diario'!R" & x & "C9:R" & y & "C9"
ActiveChart.SeriesCollection(2).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(2).Values = "='Detalle Diario'!R" & x & "C10:R" & y & "C10"
ActiveChart.SeriesCollection(3).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(3).Values = "='Detalle Diario'!R" & x & "C12:R" & y & "C12"
ActiveChart.SeriesCollection(4).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(4).Values = "='Detalle Diario'!R" & x & "C3:R" & y & "C3"
ActiveChart.SeriesCollection(5).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(5).Values = "='Detalle Diario'!R" & x & "C4:R" & y & "C4"
ActiveChart.SeriesCollection(6).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(6).Values = "='Detalle Diario'!R" & x & "C5:R" & y & "C5"
ActiveChart.SeriesCollection(7).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(7).Values = "='Detalle Diario'!R" & x & "C6:R" & y & "C6"
ActiveChart.SeriesCollection(8).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(8).Values = "='Detalle Diario'!R" & x & "C7:R" & y & "C7"
the error is this line
ActiveChart.SeriesCollection(8).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
the order series work correctly
why is the error??
regards
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(1).Values = "='Detalle Diario'!R" & x & "C9:R" & y & "C9"
ActiveChart.SeriesCollection(2).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(2).Values = "='Detalle Diario'!R" & x & "C10:R" & y & "C10"
ActiveChart.SeriesCollection(3).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(3).Values = "='Detalle Diario'!R" & x & "C12:R" & y & "C12"
ActiveChart.SeriesCollection(4).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(4).Values = "='Detalle Diario'!R" & x & "C3:R" & y & "C3"
ActiveChart.SeriesCollection(5).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(5).Values = "='Detalle Diario'!R" & x & "C4:R" & y & "C4"
ActiveChart.SeriesCollection(6).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(6).Values = "='Detalle Diario'!R" & x & "C5:R" & y & "C5"
ActiveChart.SeriesCollection(7).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(7).Values = "='Detalle Diario'!R" & x & "C6:R" & y & "C6"
ActiveChart.SeriesCollection(8).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
ActiveChart.SeriesCollection(8).Values = "='Detalle Diario'!R" & x & "C7:R" & y & "C7"
the error is this line
ActiveChart.SeriesCollection(8).XValues = "='Detalle Diario'!R" & x & "C1:R" & y & "C1"
the order series work correctly
why is the error??
regards