Hey I get this automation error when I try to create line charts with three series from a array of ranges. The runtime error is -2147221080

This only happens when I try to create the charts as an object in a worksheet. My macro works fine when creating new sheets.

My chart creation code looks like this

Do While i <= ChartCnt
        
        Charts.Add
        With ActiveChart
            .ChartType = xlLineMarkers
            
            Do Until .SeriesCollection.count = 0
                .SeriesCollection(1).Delete
            Loop
            
            .SeriesCollection.NewSeries
            .SeriesCollection.NewSeries
            .SeriesCollection.NewSeries
            .SeriesCollection(1).XValues = XRng(i)
            .SeriesCollection(1).Values = VErrRng(i)
            .SeriesCollection(1).Name = "=""Validation"""
            .SeriesCollection(2).XValues = XRng(i)
            .SeriesCollection(2).Values = TErrRng(i)
            .SeriesCollection(2).Name = "=""Training"""
            .SeriesCollection(3).XValues = XRng(i)
            .SeriesCollection(3).Values = ExpRng(i)
            .SeriesCollection(3).Name = "=""Exposures"""
           
            .Location Where:=xlLocationAsObject, Name:="AvP Charts"
            '.Location xlLocationAsNewSheet, VarName(i)
            .HasTitle = True
            .ChartTitle.Text = VarName(i)
            
            .Axes(xlValue).HasMajorGridlines = True
            .PlotArea.Interior.ColorIndex = xlNone
            .SeriesCollection(3).ChartType = xlColumnClustered
            .Legend.Position = xlLegendPositionBottom
            
            .HasAxis(xlValue, xlPrimary) = True
            .HasAxis(xlValue, xlSecondary) = True
            .Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
            .Axes(xlCategory, xlSecondary).CategoryType = xlAutomatic
        
            .ChartGroups(1).Overlap = 0
            .ChartGroups(1).GapWidth = 40
            
            If YAxis(i) <> 0 Then .Axes(xlValue, xlSecondary).MaximumScale = YAxis(i)
            If i >= 1 Then .Move after:=Sheets(VarName(i - 1))
        End With
        i = i + 1
        
    Loop
Thanks.