#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default delete chart

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default delete chart

try

ActiveSheet.ChartObjects("Chart 1").Delete

--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default delete chart

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

"Don Guillett" wrote:

try

ActiveSheet.ChartObjects("Chart 1").Delete

--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default delete chart

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
--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
I get a message that says unable to get the ChartObjects property of the
worksheet class.

"Don Guillett" wrote:

try

ActiveSheet.ChartObjects("Chart 1").Delete

--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
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




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default delete chart

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

"Don Guillett" wrote:

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
--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
I get a message that says unable to get the ChartObjects property of the
worksheet class.

"Don Guillett" wrote:

try

ActiveSheet.ChartObjects("Chart 1").Delete

--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default delete chart

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

"Don Guillett" wrote:

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
--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
I get a message that says unable to get the ChartObjects property of the
worksheet class.

"Don Guillett" wrote:

try

ActiveSheet.ChartObjects("Chart 1").Delete

--
Don Guillett
SalesAid Software

"Wayne" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete a # from the value axis on a column chart? Sallie Excel Worksheet Functions 0 September 19th 06 12:16 AM
line appears when deleting chart- cannot delete it Brian Excel Worksheet Functions 2 August 20th 06 01:46 PM
How do I delete chart superimposed on Excel document? Oz Osborn New Users to Excel 2 August 7th 06 09:01 PM
Chart, Series delete event sino Charts and Charting in Excel 1 March 29th 05 01:31 AM
Delete Chart agac8103 Charts and Charting in Excel 3 December 13th 04 04:54 AM


All times are GMT +1. The time now is 01:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"