delete chart

W

Wayne

I am trying to find a way to delete a chart with VBA.I am able to create a
chart but not delete one.Thanks for your help
Wayne
 
W

Wayne

I get a message that says unable to get the ChartObjects property of the
worksheet class.
 
D

Don Guillett

Perhaps your chart was NOT chart 1? Try this
ActiveSheet.ChartObjects(1).Delete



for all, try
for each ch in activesheet.chartobjects
ch.delete
next ch
 
W

Wayne

Thanks it works but an error message pops up it says Object vairiable or with
block variable not set.Do you know how I can get rid of this.
Thanks for your help
Wayne
 
W

Wayne

Thanks for that piece of code I got it to work thanks.I deleted my code and
used the 1 line you gave me.

Thanks
Wayne
 
Top