> For the complete documentation index, see [llms.txt](https://docs.tailent.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tailent.com/scripting-utility-classes/common-scripts-repository/c-scripts-repository/change-excel-cell-color.md).

# Change Excel Cell Color

This script will require adding **using OfficeOpenXml;** to the namespaces section.

```csharp
excelDocument.Cells[x, y].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
excelDocument.Cells[x,y].Style.Fill.BackgroundColor.SetColor(0,0,0,0);
```

{% hint style="info" %}
The ExcelWorksheet variable has to be open using the “Open excel workbook” action before initializing the C# script.

After the C# script action, use “Close excel workbook” to save the changes made.
{% endhint %}
