Graph, How to set the position of a datalabel in VBA

G

Geert

Only the property ".position" doesn't works

Sub FormatSeriesLabel(rpt As Report)

Dim chrt As Graph.Application

Set mychart = rpt.Controls("EXTRUSIE")
For x = 1 To mychart.SeriesCollection.Count
With mychart.SeriesCollection(x).Points(8)
.HasDataLabel = True 'label is
displayed
.DataLabel.Font.ColorIndex = 4 'color is
changed
.DataLabel.Position = xlLabelPositionBelow 'application or
object error
End With

' I try this code too, application or object error
'mychart.SeriesCollection(x).DataLabels(x).Position =
LabelPositionBelow

Debug.Print mychart.SeriesCollection(x).DataLabels(8).Position 'print
-4108
Next x

End Sub

Thanks,

Geert
 

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