【问题标题】:AppleScript: set Microsoft Excel cell's background colorAppleScript:设置 Microsoft Excel 单元格的背景颜色
【发布时间】:2011-02-06 16:40:55
【问题描述】:

如何使用 AppleScript 将“从 A3 到 E3 的单元格”的背景颜色更改为浅灰色?

我仍然希望字体为黑色。

【问题讨论】:

    标签: excel macos applescript


    【解决方案1】:

    此答案有两个注意事项:您没有指定 Excel 的哪个版本,以下是在 v2004 中测试的。

    tell application "Microsoft Excel"
        set theRange to range "A3:E3"
        set interiorObject to interior object of theRange
        set color index of interiorObject to 5 -- '5' is only a dummy value; change as needed.
    end tell
    

    根据字典,color index 是“颜色被指定为当前调色板的索引值”。换句话说,您安装中浅灰色的颜色索引可能在其他地方有所不同。

    【讨论】:

      猜你喜欢
      • 2017-05-02
      • 2012-09-07
      • 2010-11-21
      • 2017-03-26
      • 1970-01-01
      • 1970-01-01
      • 2017-02-08
      • 2016-12-18
      • 1970-01-01
      相关资源
      最近更新 更多