Free Support Forum -

Unable to set background color to the particular cell with Evaluation version


we are evaluating the ASPOSE.Cells for using one of our project. we are checking for the option to set the background color of the cell.

we are facing some issue regarding setting the background color to a particular cell.

But it is not setting any color. The following is the syntax used.


Coulc you please help somebody whats the problem with this code. Is this limation of using with Evaluation version?.

Prompt reply will help us further.



Thanks for considering Aspose.

Well, MS Excel (97-2003) color palette only supports 56 (0-55 indexed) colors. The palette does not have the color by default, so you have to add it to the color palette using Workbook.ChangePalette() method.

I think you may try the following code:

Workbook workbook = new Workbook();
//Add the color to the Excel palette
Worksheet sheet1 = workbook.Worksheets[0];
sheet1.Cells["A4"].Style.ForegroundColor = Color.Lime;
sheet1.Cells["A4"].Style.Pattern = BackgroundType.Solid;

Please check the following thread to know more about how to set the foreground , background, font colors etc.

<A href="</A></P> <P>Thank you.</P> <P> </P> <P> </P>

Hi Thanks,

Its working fine now....