ExcelRules1
New Member
- Joined
- Dec 6, 2011
- Messages
- 3
Hi everyone,
In my excel application I'm creating a chart with 20 points. Each point has it's own datalabel. I'm trying to partly change the color of the text of the datalabel of a specific point by using VBA. The datalabel contains the text "A10; A11; A12" and I want to change it to "A10; A11; A12": the color of text "A11" changes to red.
To manage this, I use this code (MyChart being a chart):
If I run the code, I'll receive an error: "Method Color of Object Font failed" - 2147467259 (80004005). If I put an "On Error Resume Next" around the code, it works fine except that also other point-datalabels are changed.
Can anyone help me with this problem?
I'm using Excel 2007 (SP3).
In my excel application I'm creating a chart with 20 points. Each point has it's own datalabel. I'm trying to partly change the color of the text of the datalabel of a specific point by using VBA. The datalabel contains the text "A10; A11; A12" and I want to change it to "A10; A11; A12": the color of text "A11" changes to red.
To manage this, I use this code (MyChart being a chart):
Code:
With MyChart.SeriesCollection(1).Points(3).DataLabel
.Characters(6, 3).Font.Color = vbRed
End With
If I run the code, I'll receive an error: "Method Color of Object Font failed" - 2147467259 (80004005). If I put an "On Error Resume Next" around the code, it works fine except that also other point-datalabels are changed.
Can anyone help me with this problem?
I'm using Excel 2007 (SP3).