title: Why doesn't any subsequent series after the third series get added on?
body: <p>I'm trying to plot 6 series of data but I always get a </p>
  
  <blockquote>
    <p>run time error (1004): invalid parameter </p>
  </blockquote>
  
  <p>on the fourth series. this code worked on my previous project but the data on that project is larger than this current data (see image below). Please help.</p>
  
  <p><a href="https://i.stack.imgur.com/MxnAX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MxnAX.png" alt="enter image description here"></a></p>
  
  <pre><code>Sub CreateChart()
  
  With ActiveSheet.Shapes.AddChart(Left:=10, Width:=250, Top:=100, Height:=320).Chart
      .ChartType = xlXYScatterLinesNoMarkers
      .SetSourceData Source:=Range("A2:G5")
      .ApplyLayout Layout:=8
      .Axes(xlValue).MinimumScale = "0"
      .Axes(xlValue).MaximumScale = "4"
      .SeriesCollection(1).Values = Range("A2:A5")
      .SeriesCollection(1).XValues = Range("B2:B5")
      .SeriesCollection(2).Values = Range("A2:A5")
      .SeriesCollection(2).XValues = Range("C2:C5")
      .SeriesCollection(3).Values = Range("A2:A5")
      .SeriesCollection(3).XValues = Range("D2:D5")
      .SeriesCollection(4).Values = Range("A2:A5")
      .SeriesCollection(4).XValues = Range("E2:E5")
      .SeriesCollection(5).Name = Range("F1")
      .SeriesCollection(5).Values = Range("A2:A5")
      .SeriesCollection(5).XValues = Range("F2:F5")
      .SeriesCollection(6).Values = Range("A2:A5")
      .SeriesCollection(6).XValues = Range("G2:G5")
  
  End With
  End Sub
  </code></pre>