View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lori Villarreal Lori Villarreal is offline
external usenet poster
 
Posts: 1
Default Chart Object Properties Problem

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.