Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting a series from a chart -- help required

Status
Not open for further replies.

arunmd1

Programmer
Mar 20, 2008
24
FR
Hi guys,

I need a help. I am tryin to delete a series from a chart. the problem is for that series xvalue is chosen from a cell and the cell is currently empty now.( note that it is none and not zero also).

When i try to delete it using boht methods it is showing error. I tried using
for each s in activachart.seriescollection
s.delete
next s
i also tried activechart.seriescollection(1).delete
But both are returning error as Object variable not set.
Suggest a solution.
 





Hi,

In both examples that you posted, you have ActiveChart as the primary object. Unless you have actually SELECTED the chart prior to running your code, you will get an error.

I'd suggest any chart-related code, reference THAT chart explicitly, like...
Code:
for each s in YourChartObject.seriescollection
   s.delete
next s
Caveat: Check out faq707-4811.


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top