Hey all,

I'm having one of those crazy problems where code worked for like 5 minutes, then after no changes, stops working.. ugh

Anyway.. pretty simple. Basically creating a chart, and want to get rid of the initial series that the chart comes with after creation. I have this exact code working in another part of my project, and this code worked fine for a little, then error message saying deletion of series failed.

vb Code:
  1. Set chartLeach = Charts.Add
  2.     chartLeach.name = chartName
  3.    
  4.     With chartLeach
  5.         If graphStyle = 2 Then
  6.             .ChartType = xlColumnClustered
  7.         ElseIf graphStyle = 1 Then
  8.             .ChartType = xlLine
  9.         End If
  10.        
  11.         Do Until .SeriesCollection.count = 0
  12.             .SeriesCollection(1).Delete 'FAILING
  13.         Loop
  14.     End With

Is this bad practice? I'm baffled, especially after this exact code works in other spots of my project...

Thanks much!