Adding Labels to a XY Chart

C

Chad

Hi All,

I am trying to write a chunk of code that adds labels to my XY chart.
Basically I code is very simple

ActiveWorkbook.Sheets(pChartSheet).SeriesCollection(1).Points(199).DataLabel.Text
= "199"

That line works fine, but

ActiveWorkbook.Sheets(pChartSheet).SeriesCollection(1).Points(200).DataLabel.Text
= "200"

fails with the falling error "Runtime Error 1004"

My source data has 215 entries so, 1-199 works fine, but 200 + fails.

Any ideas why?

Thanks
Chad
 
C

Chad

I was able to figure it out, but I don't know the reason behind it. In the
data series properties I needed to select 'Show Labels' radio button. It is
strange that it would fail half way through a data series though.

Thanks anyways
Chad
 

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