Free Support Forum -

Solid Style Background Color not appearing on Cell

I can’t seem to set a solid background color on a cell with Aspose Cells v3.9.0.1. The following code is used to attempt to set the background color.

using System.Drawing;
using NUnit.Framework;

namespace Aspose.Cells.Test
public class Class1
public void SetBackgroundColor()
License license = new License();

		Workbook workBook = new Workbook();
		workBook.Worksheets[0].Cells["F5"].Style.BackgroundColor = Color.Yellow;
		workBook.Worksheets[0].Cells["F5"].Style.Pattern = BackgroundType.Solid;
		workBook.Save(@"C:\Documents and Settings\t-joelb\Desktop\TestOutput.xls", FileFormatType.SpreadsheetML);


Attached is a picture of the result of this code when opened in Excel. Thanks for all your help.

-- Joel

Hi Joel,

Please check .

If pattern is solid, you should set foreground color:

workBook.Worksheets[0].Cells["F5"].Style.ForegroundColor = Color.Yellow;
workBook.Worksheets[0].Cells["F5"].Style.Pattern = BackgroundType.Solid;