Returns or sets the sheet tab color shown in Excel at the bottom of the workbook window. Same encoding as
Font.Color and
Interior.Color: the low byte is red, the middle byte is green, the high byte is blue, the top byte is zero. Use the
RGB function to build the value. Read/write Longword.
The default value is 0, which means “automatic / no tab color”. When the property is left at the default, HotXLS does not emit a BIFF8 SheetExt ($0862) record for the sheet and Excel shows the tab in its theme color. Any non-zero RGB value triggers a per-sheet SheetExt record in the workbook globals stream so the color round-trips through save/open.
The reader resolves indexed colors through the workbook palette so the application always sees a concrete RGB value, regardless of how Excel encoded the color in the source .xls file.
Syntax
property TabColor: Longword;
Example
This example sets the first sheet's tab to green and the second sheet's tab to red, then saves the workbook.
Workbook.Worksheets[1].TabColor := RGB(0, 255, 0);
Workbook.Worksheets[2].TabColor := RGB(255, 0, 0);
Workbook.SaveAs('TabColors.xls');