【问题标题】:Simple Excel Applescript简单的 Excel 小程序
【发布时间】:2020-07-02 03:08:10
【问题描述】:

我是 Applescripts 和 Excel 08 的新手?我想写一个在 Excel 08 特定颜色中任意预选单元格的颜色。我可以让它在预选的单元格中写出想要的内容,甚至加粗字体……但由于某种原因,它不会改变单元格的颜色……

print("Tell application "Microsoft Excel"
activate
set formula of active cell to "excellent answer"
set bold of font object of active cell to true
activate cell active cell");

这部分由于某种原因不起作用`

print("tell interior object of active cell of active sheet
    set color index to 3
    set pattern to pattern gray 50
    set pattern color index to 13
end tell");

不知道为什么

【问题讨论】:

    标签: excel macos applescript


    【解决方案1】:

    我能够使用以下 AppleScript 在 Excel 08(现在是 2011)中设置特定单元格的颜色:

    tell sheet "Sheet1" of theWorkbook    
    set color of interior object of range C2:C2 to {255, 255, 0}
    end tell
    

    我必须在特定范围内指定颜色并使用红色、蓝色和绿色分量值(从 0 到 255)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-07
      • 2013-10-12
      • 2011-08-30
      • 2012-02-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多