0

Excel 和 Access 之间的这些小的 VBA 语言差异变得非常烦人。我正处于最后一步(希望)让我的折线图看起来我需要它,但我无法获得仅在第一个标记上显示的数据标签。这是我到目前为止所拥有的。我已经尝试了我可以在网上找到的所有迭代,并且都得到相同的“错误 438:对象不支持此属性或方法”

With Me.ChartSpace.Charts(0).SeriesCollection(0)
    .Line.Color = sc1
    .Line.Weight = 6
    .marker.Size = 8
    .marker.Style = 2
    sName = .Name
    csName = Right(sName, Len(sName) - 8)
    .Caption = csName
    .Points(1).DataLabel.Text = csName
End With

再次感谢您的帮助。

4

1 回答 1

0

你可以试试这个..请在With Statement之前插入这些行

Me.ChartSpace.Charts(0).SeriesCollection(0).Points(1).DataLabel.Select
Selection.Format.TextFrame2.TextRange.Characters.Text = "Name"

如果问题仍然存在,请尝试更改Me.ChartSpace.Charts(0)Sheets("SheetName").ChartObjects("ChartName")输入适当的SeriesCollection号码

于 2017-05-03T05:26:12.997 回答