GetFillColor
Get the background color for the current cell range
Returns:
- Type
-
ApiColor | 'No Fill'
Example
Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oWorksheet.SetColumnWidth(0, 60);
oRange = oWorksheet.GetRange("A1");
oRange.SetFillColor(Api.CreateColorFromRGB(255, 224, 204));
oRange.SetValue("This is the cell with a color set to its background.");
oFillColor = oRange.GetFillColor();
oWorksheet.GetRange("A3").SetValue("This is another cell with the same color set to its background");
oWorksheet.GetRange("A3").SetFillColor(oFillColor);
builder.SaveFile("xlsx", "GetFillColor.xlsx");
builder.CloseFile();
Resulting document