Get Started
Documentation

SetFontColor

SetFontColor(oColor)

Set the text color for the current cell range with the previously created color object.

Parameters:

Name Type Description
oColor ApiColor The color object previously created to set the color to the text in the cell/cell range.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A2").SetFontColor(Api.CreateColorFromRGB(49, 133, 154));
oWorksheet.GetRange("A2").SetValue("This is the text with a color set to it");
oWorksheet.GetRange("A4").SetValue("This is the text with a default color");
builder.SaveFile("xlsx", "SetFontColor.xlsx");
builder.CloseFile();

Resulting document