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

Free Support Forum - aspose.com

Problem applying color to the cells using aspose.cells

Hi Support team,

I am trying to insert content in a excel file using aspose.Cells.

I am trying to change the color of the cell, but not getting it right.

worksheet.Cells[“B8”].Style.BackgroundColor = Color.Red;

When i view the excel file color was not applied to that cell.

I also tried doing it in this way.

Aspose.Cells.Style style1 = worksheet.Cells[“B8”].GetStyle();

But getting this error.

aspose.cells does not contain a definition for getstyle and no extension method getstyle accepting a first argument of type “aspose.cells.cell” could be found.

Please let me know what issue is?

With Regards,


It looks like you are using some older version of the product. If you want to persist with your older version, you may try to change the line of code:
worksheet.Cells[“B8”].Style.BackgroundColor = Color.Red

worksheet.Cells[“B8”].Style.ForegroundColor = Color.Red;
worksheet.Cells[“B8”].Style.Pattern = BackgroundType.Solid;

it should fix your issue.

Let us know if I can be of any further help.

Thank you.