0

此脚本通过错误“Microsoft Excel 出现错误:活动工作簿的工作表“sheet1”不理解设置的图表元素消息。”

tell application "Microsoft Excel"
    tell worksheet "Sheet1" of active workbook
        set ochart1 to chart of chart object 1
           tell ochart1
               set chart element chart element 1
               --- create the chart title on chart with value 1
           end tell
    end tell
end tell

在此处输入图像描述.

在此处输入图像描述

4

2 回答 2

1

这也有效。为什么要使用 set chart element 命令创建图表标题?

tell application "Microsoft Excel"
    tell worksheet "Sheet1" of active workbook
        set ochart1 to chart of chart object 1
        tell ochart1
            set chart title text of it's chart title to "My Title"
        end tell
    end tell
end tell
于 2012-11-08T16:15:12.390 回答
0

如果您想创建一个图表标题,这对我有用:

tell application "Microsoft Excel"
    tell worksheet "Sheet1" of active workbook
        set ochart1 to chart of chart object 1
        tell ochart1
            set has title to true                       
            set caption of its chart title to "your title here"         
        end tell
    end tell
end tell
于 2012-11-08T07:23:25.273 回答