AppleScript的:设置微软Excel单元格的背景颜色 [英] AppleScript: set Microsoft Excel cell's background color

查看:402
本文介绍了AppleScript的:设置微软Excel单元格的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用AppleScript,我怎么能变细胞,从A3到E3以浅灰色的背景颜色?

Using AppleScript, how can I change the background color of "cells ranging from A3 to E3" to light grey?

我还是想的字体是黑色的。

I still want the font to be in black.

推荐答案

二警告这个答案:没有指定的Excel的版本了,下面是在v2004测试

Two caveats with this answer: You didn't specify which version of Excel, and the following was tested in 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

每字典,色指数是色彩被指定为索引值到当前的调色板。换言之,显色指数是浅灰在安装也许不同别处

Per the dictionary, color index is "the color is specified as an index value into the current color palette". In other words, the color index that is light gray in your install maybe different elsewhere.

这篇关于AppleScript的:设置微软Excel单元格的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆