Reputation:
I am new to Applescripts and Excel 08? I want to write one that colors arbitrarily preselected cells in Excel 08 specific colors. I can get it to write want in an preselected cell and even bold the font...but for some reason it will not change the color of the cell...
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");
This part doesn't work for some reason`
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");
not sure why
Upvotes: 1
Views: 2702
Reputation: 4758
I was able to set the color of a particular cell in Excel 08 (and 2011 now) using the following AppleScript:
tell sheet "Sheet1" of theWorkbook
set color of interior object of range C2:C2 to {255, 255, 0}
end tell
I had to specify the color on a particular range and use the Red, Blue, and Green component values (from 0-255).
Upvotes: 1