We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set Customized Color in Cell


How to Set customized colors in Cell.


Hi Sunil,

Thank you for considering Aspose.

You can use Style.ForegroundColor to set the color of a Cell. Please see the sample code which assigns Foreground color to a Cell.

Workbook wb= new Workbook();
Cells cells = wb.Worksheets[0].Cells;
Cell cell = cells[0,0];
int index = wb.Styles.Add();
Style style = wb.Styles[index];
//For Cell's filling color
style.ForegroundColor = System.Drawing.Color.FromArgb(0, 255, 255);;
style.Pattern = BackgroundType.Solid;
cell.Style = style;

Please see the following link for colors & Background Patterns,


Thank you & Best Regards,