I'm trying to write a macro that will create charts from data that is imported from Access. Depending on the data it might create any number of charts. I have that part working just fine, but I can't figure out how to automatically clear out the old charts.
Part of the problem is that I don't see a way to control the naming of a new chart and so Excel automatically increments the chart number by one every time it creates a new chart even if the previous charts are no longer there. This prevents me from being able to create a loop that starts from Chart1 and goes through some safe number like Chart50 because eventually it will have gone higher then that. Is there a way to tell it to delete all of the charts on a certain worksheet or to control the naming when they are created?
Thanks.
Part of the problem is that I don't see a way to control the naming of a new chart and so Excel automatically increments the chart number by one every time it creates a new chart even if the previous charts are no longer there. This prevents me from being able to create a loop that starts from Chart1 and goes through some safe number like Chart50 because eventually it will have gone higher then that. Is there a way to tell it to delete all of the charts on a certain worksheet or to control the naming when they are created?
Thanks.