NativeExcel2 for .Net Developer's Reference

IInterior.ColorIndex Property

Gets or sets the color of the interior as an index into the current color palette, or as one of the XlColorIndex values.

[Visual Basic]

Property Value

The color index of the specified interior.


Set this property to XlColorIndex.xlColorIndexAutomatic to specify the automatic fill. Set this property to XlColorIndex.xlColorIndexNone to specify no interior fill.


This example sets the color index of the range A1:C10 interior to 10.

IInterior interior = book.Worksheets[1].Cells["A1:C10"].Interior;
interior.Pattern = XlPattern.xlChecker;
interior.PatternColorIndex = 8;
interior.ColorIndex = 10;
Dim interior As IInterior = book.Worksheets(1).Cells("A1:C10").Interior
interior.Pattern = XlPattern.xlChecker
interior.PatternColorIndex = 8
interior.ColorIndex = 10
IInterior* interior = book->Worksheets->Item[1].Cells->Item[S"A1:C10"]->Interior;
interior->Pattern = XlPattern::xlChecker;
interior->PatternColorIndex = 8;
interior->ColorIndex = 10;

See Also

IInterior Interface | NativeExcel Namespace | XlColorIndex Class | IPalette Interface | Colors Property | Interior Property