Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Problem deleting series in a chart

Hello,

I have a chart that has either one or two series in it, and I want to
delete all series in the chart so I can rebuild them. Using the following
code

ActiveChart.SeriesCollection.Delete

I receive the following error

Error 438 Object doesn't support this property or method


How can I delete all series without getting the error.

Thank you,

keith

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Problem deleting series in a chart

Dear Keith

Please try this and feedback.

For intTemp = 1 to ActiveChart.SeriesCollection.count
ActiveChart.SeriesCollection(intTemp).Delete
Next intTemp

If this post helps click Yes
---------------
Jacob Skaria


"keith" wrote:

Hello,

I have a chart that has either one or two series in it, and I want to
delete all series in the chart so I can rebuild them. Using the following
code

ActiveChart.SeriesCollection.Delete

I receive the following error

Error 438 Object doesn't support this property or method


How can I delete all series without getting the error.

Thank you,

keith

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Problem deleting series in a chart

HI Jacob,
Thanks very much. I did not mention it in this latest message, but I tried
a for/next loop approach first and received occasional errors. I added an
error check by adding "on error resume next" before the delete statement, and
with that in place, I occasionally end up with a series that is not deleted.
I thought maybe the ActiveChart.SeriesCollection.Delete statement might
solve the problem. Am trying to see if there is another way to delete all
series' in the active chart without encountering errors.
Keith


"Jacob Skaria" wrote:

Dear Keith

Please try this and feedback.

For intTemp = 1 to ActiveChart.SeriesCollection.count
ActiveChart.SeriesCollection(intTemp).Delete
Next intTemp

If this post helps click Yes
---------------
Jacob Skaria


"keith" wrote:

Hello,

I have a chart that has either one or two series in it, and I want to
delete all series in the chart so I can rebuild them. Using the following
code

ActiveChart.SeriesCollection.Delete

I receive the following error

Error 438 Object doesn't support this property or method


How can I delete all series without getting the error.

Thank you,

keith

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Problem deleting series in a chart

Could you please let me know the error message when you try the below code.
--
If this post helps click Yes
---------------
Jacob Skaria


"keith" wrote:

HI Jacob,
Thanks very much. I did not mention it in this latest message, but I tried
a for/next loop approach first and received occasional errors. I added an
error check by adding "on error resume next" before the delete statement, and
with that in place, I occasionally end up with a series that is not deleted.
I thought maybe the ActiveChart.SeriesCollection.Delete statement might
solve the problem. Am trying to see if there is another way to delete all
series' in the active chart without encountering errors.
Keith


"Jacob Skaria" wrote:

Dear Keith

Please try this and feedback.

For intTemp = 1 to ActiveChart.SeriesCollection.count
ActiveChart.SeriesCollection(intTemp).Delete
Next intTemp

If this post helps click Yes
---------------
Jacob Skaria


"keith" wrote:

Hello,

I have a chart that has either one or two series in it, and I want to
delete all series in the chart so I can rebuild them. Using the following
code

ActiveChart.SeriesCollection.Delete

I receive the following error

Error 438 Object doesn't support this property or method


How can I delete all series without getting the error.

Thank you,

keith

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Problem deleting series in a chart

No, you should either loop backwards:

For intTemp = ActiveChart.SeriesCollection.count to 1 step -1
ActiveChart.SeriesCollection(intTemp).Delete
Next intTemp

or keep deleting series 1 until there are no more series:

For intTemp = 1 to ActiveChart.SeriesCollection.count
ActiveChart.SeriesCollection(1).Delete
Next intTemp

- Jon
-------
Jon Peltier, Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
Advanced Excel Conference - Training in Charting and Programming
http://peltiertech.com/Training/2009...00906ACNJ.html
_______


"Jacob Skaria" wrote in message
...
Dear Keith

Please try this and feedback.

For intTemp = 1 to ActiveChart.SeriesCollection.count
ActiveChart.SeriesCollection(intTemp).Delete
Next intTemp

If this post helps click Yes
---------------
Jacob Skaria


"keith" wrote:

Hello,

I have a chart that has either one or two series' in it, and I want to
delete all series' in the chart so I can rebuild them. Using the
following
code

ActiveChart.SeriesCollection.Delete

I receive the following error

Error 438 Object doesn't support this property or method


How can I delete all series' without getting the error.

Thank you,

keith



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
Finding Chart Series Problem WhytheQ Excel Programming 2 November 20th 08 11:22 AM
Dynamic chart - series label problem pignick Charts and Charting in Excel 2 May 27th 08 07:54 PM
Problem adding Series XValues to Chart using VBA Sean Curry Charts and Charting in Excel 0 March 14th 05 12:18 AM
Q. Pie Chart problem. Want to add series, from another worksheet. Jim Jones Excel Programming 3 January 6th 04 03:13 AM
international problem, decimal separator and chart series Brian Murphy Excel Programming 5 December 16th 03 05:04 PM


All times are GMT +1. The time now is 04:59 AM.

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

About Us

"It's about Microsoft Excel"