Hi,
How to set the background color in closed xml (C#)
Thanks
Hi,
How to set the background color in closed xml (C#)
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pankajkumar PatelRank #181 · 13.4K reputationPosted Dec 14, 2022, 6:46 AM EST
Hi Sathish,
To set the background color in closed xml in C#:
using ClosedXML.Excel; using var wbook = new XLWorkbook(); var ws = wbook.Worksheets.Add("Sheet1"); ws.Range("D2:E2").Style.Fill.BackgroundColor = XLColor.Gray; ws.Ranges("C5, F5:G8").Style.Fill.BackgroundColor = XLColor.Gray;For more details:
Hope this will help you!