ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   delete chart (https://www.excelbanter.com/excel-discussion-misc-queries/141351-delete-chart.html)

Wayne

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

Don Guillett

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



Wayne

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




Don Guillett

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





Wayne

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





Wayne

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





Don Guillett

delete chart
 

Glad to help
--
Don Guillett
SalesAid Software

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







All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com