FullSeriesCollection生成“编译错误:未找到方法或数据成员”。在Excel 2010中 [英] 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
这适用于运行Excel 2013的计算机。
This works on machines running Excel 2013.
使用Excel 2010 。 FullSeriesCollection(1)
生成错误:
With Excel 2010 .FullSeriesCollection(1)
generates an error:
编译错误:未找到方法或数据成员
"Compile Error: Method or data member not found"
我用Google搜索了这个主题,当时找不到任何东西。我确实在今年早些时候从Windows更新中遇到了ActiveX问题,并且无法在运行要测试的Excel 2010的计算机上找到任何.exd文件。
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.
推荐答案
FullSeriesCollection
是在Excel 2013中添加了。在早期版本中,它不是有效的属性。
FullSeriesCollection
was added in Excel 2013. It isn't a valid property in earlier versions.
用 SeriesCollection
替换 FullSeriesCollection
Excel 2010。
Replace FullSeriesCollection
with SeriesCollection
, which is valid in Excel 2010.
Siddharth Rout 的发布者致谢此答案作为评论。
Credits to Siddharth Rout who posted this answer as a comment.
这篇关于FullSeriesCollection生成“编译错误:未找到方法或数据成员”。在Excel 2010中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!