Returns or sets the colour of the border. Use the
RGB function to create a colour value. Read/write LongWord.
Setting Color on the BIFF8 path writes the exact RGB through the XFExt $087D rich-colour side record on the matching edge slot (Excel 2007+ reopens the workbook with the literal RGB) and a best-match indexed icv on the XF wire (legacy Excel 97-2003 readers see the 56-colour palette approximation). Read-back consults the same XFExt side-table. Compound selectors (xlAround, xlInsideVertical, xlInsideHorizontal, xlInsideAll) register one XFExt slot per physical edge in a single cell-loop pass.
For theme-based addressing use the companion
SetThemeColor method (also available on every edge selector), which encodes an Office theme idx + tint into the same XFExt slot so Excel re-tints the border when the workbook theme palette changes. See
Classic XLS colour model for the overall RGB / index / theme decision tree.
Syntax
property Colour: LongWord;
Example
This example sets the colour of the top edge border of A1:D1 range.
Workbook.Sheets[1].Range['A1', 'D1'].Borders[xlEdgeTop].Color := RGB(0, 255, 0);