Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
Scott Wagner
 
Posts: n/a
Default Macro to add labels to data points in an xy scatter chart

I have searched these boards, and am still without a good solution. Hoping
you can help.

I am aware of add in programs that will achieve this result, but I don't
have that option because of the number of users I have, and permissions to
install on our network. (sucks) I found this item in the microsoft support
pages and am trying to apply the macro in the example.

http://support.microsoft.com/default...b;en-us;213750

Everything works fine, the lables attach to the data points as expected, but
I get "Run-time error '1004': Unable to set the HasDataLabel property of
the Point class" when I run the macro. I click end, and the data points show
up.

I don't want to release this spreasheet to users until this issue is worked
out. Any ideas why this is happening, or do you know how to close that run
time error window with VBA?

Thanks so much,

Scott Wagner
  #2   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Macro to add labels to data points in an xy scatter chart

For some reason, does the particular point that crashes not appear in the
chart, because it's not a plottable value? Such as #N/A or a blank? Since
the point isn't plotted, you can't apply a data label.

You could insert some error evasion code:

For Counter = 1 To Range(xVals).Cells.Count
On Error Resume Next
ActiveChart.SeriesCollection(1).Points(Counter).Ha sDataLabel = _
True
ActiveChart.SeriesCollection(1).Points(Counter).Da taLabel.Text = _
Range(xVals).Cells(Counter, 1).Offset(0, -1).Value
On Error Goto 0
Next Counter

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


"Scott Wagner" wrote in message
...
I have searched these boards, and am still without a good solution. Hoping
you can help.

I am aware of add in programs that will achieve this result, but I don't
have that option because of the number of users I have, and permissions to
install on our network. (sucks) I found this item in the microsoft
support
pages and am trying to apply the macro in the example.

http://support.microsoft.com/default...b;en-us;213750

Everything works fine, the lables attach to the data points as expected,
but
I get "Run-time error '1004': Unable to set the HasDataLabel property of
the Point class" when I run the macro. I click end, and the data points
show
up.

I don't want to release this spreasheet to users until this issue is
worked
out. Any ideas why this is happening, or do you know how to close that
run
time error window with VBA?

Thanks so much,

Scott Wagner



  #3   Report Post  
Posted to microsoft.public.excel.charting
Scott Wagner
 
Posts: n/a
Default Macro to add labels to data points in an xy scatter chart

That works perfectly!

Thanks!

"Jon Peltier" wrote:

For some reason, does the particular point that crashes not appear in the
chart, because it's not a plottable value? Such as #N/A or a blank? Since
the point isn't plotted, you can't apply a data label.

You could insert some error evasion code:

For Counter = 1 To Range(xVals).Cells.Count
On Error Resume Next
ActiveChart.SeriesCollection(1).Points(Counter).Ha sDataLabel = _
True
ActiveChart.SeriesCollection(1).Points(Counter).Da taLabel.Text = _
Range(xVals).Cells(Counter, 1).Offset(0, -1).Value
On Error Goto 0
Next Counter

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


"Scott Wagner" wrote in message
...
I have searched these boards, and am still without a good solution. Hoping
you can help.

I am aware of add in programs that will achieve this result, but I don't
have that option because of the number of users I have, and permissions to
install on our network. (sucks) I found this item in the microsoft
support
pages and am trying to apply the macro in the example.

http://support.microsoft.com/default...b;en-us;213750

Everything works fine, the lables attach to the data points as expected,
but
I get "Run-time error '1004': Unable to set the HasDataLabel property of
the Point class" when I run the macro. I click end, and the data points
show
up.

I don't want to release this spreasheet to users until this issue is
worked
out. Any ideas why this is happening, or do you know how to close that
run
time error window with VBA?

Thanks so much,

Scott Wagner




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
Data point labels in XY scatter chart TonyGB007 Charts and Charting in Excel 1 December 9th 05 09:13 AM
Height (in points) of data point in chart above x-axis Scott P Charts and Charting in Excel 5 November 13th 05 01:56 AM
How do I select multiple data points on my chart? Matthew S Charts and Charting in Excel 1 September 13th 05 06:38 PM
XL Chart: Separately align series and value data labels Stuart Bratesman Charts and Charting in Excel 3 August 10th 05 11:07 PM
Data Points in Scatter Chart CWILSON Charts and Charting in Excel 2 January 25th 05 04:41 PM


All times are GMT +1. The time now is 07:52 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"