Changer la couleur des cellules dans Excel avec C#
Changer la couleur des cellules dans Excel avec C#
Comment modifier la couleur de fond d'une cellule Excel en utilisant C# ?
Re: Changer la couleur des cellules dans Excel avec C#
**Avec EPPlus :**
```csharp
ws.Cells[1, 1].Style.Fill.PatternType = ExcelFillStyle.Solid;
ws.Cells[1, 1].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
```
**Avec Interop :**
```csharp
Excel.Range range = worksheet.Cells[1, 1];
range.Interior.Color = ColorTranslator.ToOle(Color.Yellow);
```
```csharp
ws.Cells[1, 1].Style.Fill.PatternType = ExcelFillStyle.Solid;
ws.Cells[1, 1].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
```
**Avec Interop :**
```csharp
Excel.Range range = worksheet.Cells[1, 1];
range.Interior.Color = ColorTranslator.ToOle(Color.Yellow);
```