Color Question


How can I set the backcolour of a cell to light blue?

I’m using the following

styleindex = styles.Add
style = styles(styleindex)
style.Font.Size = 7
style.Font.IsBold = False
style.ForegroundColor = Color.LightBlue
style.Pattern = BackgroundType.Solid
style.Name = "SmallTableLightBlue"

but it just comes out black. Using blue and red are OK, but as soon as I use a non-standard colour it appears black.


Hi, Andy.

If you want to use a non-standard color. Please use Excel.ChangePalette to change color palette first.

excel.ChangePalette(Color.LightBlue, 55);

Then you can use your code to change foreground color.