Unable to typecast system.drawing.color to aspose.cells.color

I am unable to typecast system.drawing.color to aspose.cells.color, I have the requirement to set some particular character of a cell to some specific color in RGB Format, but its not being possible. Please help Thanks

Hi,


Thanks for your query.

I have tested your scenario/ case using the following sample code, it works fine. Please see the following sample code that denotes on how to set a custom RGB color to selected set of chars in the cell value for your needs for your reference:
e.g
Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Cells cells = worksheet.Cells;
Cell aCell = worksheet.Cells[“A1”];
aCell.PutValue(“My test Data”);
//Defind custom color(s)
Color color1 = Color.FromArgb(153, 51, 102);
//Specify the color for “test” only in the cell’s value
aCell.Characters(3, 4).Font.Color = color1;
workbook.Save(“e:\test2\outchartestcolor1.xlsx”);

Hope, this helps a bit.

Thank you.

Thanks a lot,

Umesh

Hi,


Good to know that your issue is sorted out now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.