Re: How do I change Object Color in Excel?
Re: How do I change Object Color in Excel?
- Subject: Re: How do I change Object Color in Excel?
- From: Christian Prinoth <email@hidden>
- Date: Mon, 1 Mar 2010 09:43:02 +0100
Thanks for your reply. I am aware that excel sets the colors to the closest match on the palette, so my example might be a bit unclear to that respect. I did try to change color from black to red, without success. First I tried with {255,0,0} as I would to in vba, then I also tried {65535,0,0} which I think is the 16 bit RGB representation for red, again without success.
Chris
On Mon, Mar 1, 2010 at 09:33, Barry Wainwright
<email@hidden> wrote:
On 27/02/2010 23:38, "Christian Prinoth" wrote:
I am trying to do the following:
tell application "Microsoft Excel"
set ccc to color of font object of range "A1"
set color of font object of range "A1" to {255, 0, 0}
set ccc to color of font object of range "A1"
end tell
after the first line I get the result {221,8,6}, and after the third I still get the same, so obviously the second line is not doing anything.
It does work by using "color index" instead of "color", like this:
set font color index of font object of range "A1" to 3
but that is useless in situations where the palette has been modified.
Excel has only a limited ability to display colors – you can't have the full range of 256256256 colors – it uses a simple palette of (IIRC) 64 colors. If you try and set a color value using a valu tht is not in the current palette, Excel sets the color to the nearest equivalent in the palette.
Hence, in your example, {255,0,0} must not be in the palette, but {221,8,6} is the nearest equivalent.
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden