Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I use this code that I get from Excel VBA 2002 I get an error 1004.
Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
not sure but the code you posted has this xlLOabelPositionAbove that is misspelled. should be xlLabelPositionAbove. did you know that? regards FSt1 "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tje obvious answer is that you have two words misspelled.
pt.datalabel.position = xlLabelPositionAbove -- Regards, Tom Ogilvy "hturk" wrote in message ... When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I made a typo when posting this code. But my actual codes is correct.
"Tom Ogilvy" wrote: Tje obvious answer is that you have two words misspelled. pt.datalabel.position = xlLabelPositionAbove -- Regards, Tom Ogilvy "hturk" wrote in message ... When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are probably trying to specify the position for a column chart type. That
constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are correct. What would I need to do to position the datalabels above
each point for the columns. Harry "Alok" wrote: You are probably trying to specify the position for a column chart type. That constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Harry
Try the constant xlLabelPositionInsideEnd Alok "hturk" wrote: You are correct. What would I need to do to position the datalabels above each point for the columns. Harry "Alok" wrote: You are probably trying to specify the position for a column chart type. That constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alok
Thanks I will try tommorrow morning and I will let you know how it went. How can I found out which constants apply to which charts. Thank You Very Much Harry "Alok" wrote: Harry Try the constant xlLabelPositionInsideEnd Alok "hturk" wrote: You are correct. What would I need to do to position the datalabels above each point for the columns. Harry "Alok" wrote: You are probably trying to specify the position for a column chart type. That constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"hturk" wrote in message
... How can I found out which constants apply to which charts. Hi Harry, Download and install my XY Chart Labeler utility from the web site below my signature. Once installed, open Excel, go into the Visual Basic Editor, locate the XYChartLabeler project in the Project Window and set the IsAddIn property of its ThisWorkbook object to False. The top table on the worksheet that you can now see back in the Excel user interface provides a complete list of which label position constants can be used with which chart types. -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm "Alok" wrote: Harry Try the constant xlLabelPositionInsideEnd Alok "hturk" wrote: You are correct. What would I need to do to position the datalabels above each point for the columns. Harry "Alok" wrote: You are probably trying to specify the position for a column chart type. That constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It worked fine thank you very Much
Harry "hturk" wrote: Alok Thanks I will try tommorrow morning and I will let you know how it went. How can I found out which constants apply to which charts. Thank You Very Much Harry "Alok" wrote: Harry Try the constant xlLabelPositionInsideEnd Alok "hturk" wrote: You are correct. What would I need to do to position the datalabels above each point for the columns. Harry "Alok" wrote: You are probably trying to specify the position for a column chart type. That constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once again thank you very much for the tremendous help
Harry "hturk" wrote: Alok Thanks I will try tommorrow morning and I will let you know how it went. How can I found out which constants apply to which charts. Thank You Very Much Harry "Alok" wrote: Harry Try the constant xlLabelPositionInsideEnd Alok "hturk" wrote: You are correct. What would I need to do to position the datalabels above each point for the columns. Harry "Alok" wrote: You are probably trying to specify the position for a column chart type. That constant (xlLabelPositionAbove) is valid for line graph but is not acceptable for column chart type. Alok "hturk" wrote: When I use this code that I get from Excel VBA 2002 I get an error 1004. Dim se as Series Dim pts as Points Dim pt as Point Set se = ActiveChart.SeriesCollection(2) se.HasDataLabels = True Set pts =se.Points For each pt in pts pt.datalabel.posiotion = xlLOabelPositionAbove - error 1004 happens here. next pt Does anyone have an idea as to what I am doing wrong. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Lock the chart but leave datalabels position editable | Charts and Charting in Excel | |||
Be able to edit position of datalabels in a protected chart. | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Geeting error while setting datalabels through VBA | Excel Programming |