Check for empty SeriesCollection on chart

T

taxidermist

I have an application that draws numerous charts. Sometimes a series
on the chart will not have any data in it. I need to change the
marker forecolor to black on all of the seriescollections. Of course
if there is no data in the series there is nothing to change the color
of and my application fails. Is there a way to check a
seriescollection and change the marker color if it is not empty but
bypass it if it is empty?

This is the code I am using to change the color.
<code>
shpGraph.SeriesCollection(3).MarkerForegroundColorIndex =
1 shpGraph.SeriesCollection(3).MarkerStyle =
xlCircle
shpGraph.SeriesCollection(3).MarkerSize = 7
</code>

I need something like (pseudo)
if shpGraph.seriescollection(3) not empty then
'la la la change marker color
end if
 
A

Andy Pope

Hi,

The simplest approach maybe to create a function with error trapping to do
that code. Then catch any error and return.

Otherwise you would need to check each point in the series for a value.

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top