0

我想使用苹果脚本在 excel 2011 中创建一个包含多个系列的图表。

    tell application "Microsoft Excel"
    tell worksheet "Sheet1" of active workbook
        set obj to make new chart object at end with properties {left position:20, top:88, width:33, height:90}
        set ochart to chart of obj
        set chart type of ochart to column clustered
        set series 1 of series collection to ochart
        tell series 1
            set xvalues to "=Sheet1!$B$7:$B$10"
            set name to "shartseries1"
        end tell
    end tell
end tell

在此脚本中创建图表并成功设置图表类型,但未创建图表系列。

4

1 回答 1

1

尝试:

tell application "Microsoft Excel"
    tell worksheet "Sheet1" of active workbook
        set obj to make new chart object at end with properties {left position:20, top:88, width:33, height:90}
        set ochart to chart of obj
        tell ochart
            set chart type to column clustered
            set newSeries to make new series at end with properties {series values:"=Sheet1!$B$7:$B$10", xvalues:"=Sheet1!$B$7:$B$10", name:"shartseries1"}
        end tell
    end tell
end tell
于 2012-10-17T03:52:40.880 回答