Hi,
I'm trying to delete one series from a chart using vba. I turned on the macro recorder and got the following lines of VBA (I'm using Office 2013):
ActiveChart.FullSeriesCollection(3).Select
Selection.delete
When I execute this code it crashes Excel. However, when I put a breakpoint on "Selection.delete" and step through it, series 3 is correctly deleted and then I can continue the macro without problems. Is this a bug in Excel?
I had something similar working with Office 2010 (ActiveChart.SeriesCollection(3).Delete), but that no longer works and neither has a number of other variations on this theme. Is there another way to delete a single series? In my case it is always series 3.
Thanks,
Jim
Update 1: I've tried just using a two statement macro to delete series 3 from an existing chart with 3 series:
ActiveChart.FullSeriesCollection(3).Select
Selection.delete
The above works. It just doesn't work in my larger program. I've also tried putting the above two lines in a sub routine, but Excel still hangs unless I put a break point on the Selection.delete and step through it and then resume executing.
Jim
Bookmarks