Skip to content
本页内容

Index (属性)

返回 int 值,它代表对象在其同类对象所组成的集合内的索引号。

示例

python
#本示例显示工作表 Sheet1 第一个内嵌图表中第一个图表组的索引号
def test():
    chartgroup = Application.Worksheets.Item("Sheet1").ChartObjects(1).Chart.ChartGroups(1)
    print(chartgroup.Index)
python
#本示例判断如果图表工作表 Chart1 中第一个图表组的索引号为1,则开启该图表组中的垂直线
def test():
    chartgroup = Application.Charts.Item("Chart1").ChartObjects(1).Chart.ChartGroups(1)
    if chartgroup.Index == 1:
        chartgroup.HasDropLines = True