HotXLS-dokumentation

Color egenskap

Returnerar or sets the cell shading color of the range. Use the RGB function to create a color value. Read/write LongWord
Setting Color på BIFF8-vägen skriver exakt RGB via XFExt-sidoposten $087D för rik färg (Excel 2007+ öppnar arbetsboken igen med den bokstavliga RGB-färgen) och ett bäst matchande indexerat icv på XF-tråden (läsare i Excel 97-2003 ser 56-färgspalettsapproximationen). XFExt-sidotabellen används också vid läsning, så celler som kommer tillbaka från Excel visar sin ursprungliga RGB i stället för palettapproximationen
For theme-based addressing use the companion SetThemeColor / SetPatternThemeColor -metoder, som kodar Office-tema idx + tint i samma XFExt-plats så att Excel tonar om cellen när arbetsbokens temapalett ändras. Se Classic XLS color model for the overall RGB / index / theme decision tree

Syntax

property Color: LongWord;

Exempel

This example sets the color of the range A1:C10 interior to red

Workbook.Worksheets[1].Range['A1', 'C10'].Interior.Color := xlRed;