Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FullSeriesCollection generates "Compile Error: Method or Data Member not found" in Excel 2010

I created a macro that adds data labels to the two series in my pivot chart.

Sub Data_Labels_On_Pivot2()
'
' Data_Labels_On_Pivot2 Macro
'

'
    ActiveSheet.Unprotect
    ActiveSheet.ChartObjects("Chart 14").Activate
    ActiveChart.SetElement (msoElementDataLabelCenter)
    ActiveSheet.ChartObjects("Chart 14").Activate
    ActiveChart.FullSeriesCollection(1).DataLabels.Select
    Selection.Position = xlLabelPositionOutsideEnd
    Application.CommandBars("Format Object").Visible = False
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

This works on machines running Excel 2013.

With Excel 2010 .FullSeriesCollection(1) generates an error:

"Compile Error: Method or data member not found"

I googled this topic and was not able to find anything. I did come across the ActiveX issues from the Windows update earlier this year and was not able to find any .exd files on the machine running Excel 2010 that I am testing with.

like image 693
JPerez Avatar asked Sep 09 '15 14:09

JPerez


People also ask

How do I fix compile errors in Excel VBA?

I have resolved same error by following these 4 steps : Open Excel file which is having issue, press Alt + F11 go into its Visual Basic Editor. From the Tools menu select References ( Note, if references option is disabled in tools menu try closing and reopening file and enable Macro before proceeding next steps)

What is compile error in Excel VBA?

Compile error in hidden module: <module name>This error commonly occurs when code is incompatible with the version or architecture of this application (for example, code in a document targets 32-bit Microsoft Office applications but it is attempting to run on 64-bit Office).

What does compile error for without next mean?

May 02, 2018 by Archana Oswal in Error. The “Next Without For” Compile Error is a very common compile-time error in Excel VBA. It implies that a Next statement must always have a preceding For statement that matches it. If a Next statement is used without a corresponding For statement, this error is generated.


1 Answers

FullSeriesCollection was added in Excel 2013. It isn't a valid property in earlier versions.

Replace FullSeriesCollection with SeriesCollection, which is valid in Excel 2010.

Credits to Siddharth Rout who posted this answer as a comment.

like image 177
2 revs Avatar answered Sep 30 '22 15:09

2 revs