PC Review


Reply
Thread Tools Rate Thread

Adding Labels to a XY Chart

 
 
Chad
Guest
Posts: n/a
 
      18th Jul 2008
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


 
Reply With Quote
 
 
 
 
Chad
Guest
Posts: n/a
 
      19th Jul 2008
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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to change position of chart labels on line chart Shane Henderson Microsoft Excel Charting 1 27th May 2011 09:31 AM
Adding labels to a bubble chart other than the X, Y or Z values Jeff in GA Microsoft Excel Misc 3 23rd Sep 2009 03:52 AM
Pivot Chart - X-axis labels when adding data mauders Microsoft Excel Charting 0 16th Apr 2009 03:06 PM
Adding labels to a waterfall BAR chart =?Utf-8?B?bXIgdG9t?= Microsoft Excel Charting 4 3rd Jul 2007 04:12 PM
Adding custom XYscatter labels to Excel Chart from Access VBA dne Microsoft Access VBA Modules 2 12th Sep 2005 07:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:41 AM.