Chart Object Properties Problem

L

Lori Villarreal

I have a macro that creates a 3D pie chart. The chart is successfully
created, but without the data labels.

1. Why aren't the data labels created during the macro recording and don't
show up when the macro is run?

2. I am getting the error "Object doesn't support this property or method"
when I try to create the data labels using VBA - Is there a reference that I
need to add that will make these properties available?

Here is my code:

With Charts("Chart1").SeriesCollection(1).Points(5)
.HasDataLabel = True
.HasLeaderLines = True
.ShowCategoryName = True
.ShowPercentage = True
.ApplyDataLabels Type:=xlValue
End With

I don't believe there's anything wrong with the code - it just doesn't like
the .HasLeaderLines, .ShowCategoryName and .ShowPercentage properties. As I
said, they are not available to use with ActiveChart.
 

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