I have an excel file located on SharePoint. I am reading the excel file in C# using OpenXML. While reading the data, I also need the information of any styles that are been added to the cells.
If there is any cell that has been added a background color to, How can I read it in C# ?
CodePudding user response:
Have a look at this you will find some references about foreground color and background color of cell
I hope it can help you!
CodePudding user response:
That's as simple as following:
using Excel = Microsoft.Office.Interop.Excel;
var cellColor = sheet.Cells[rowIndex, colIndex].Style.Fill.BackgroundColor;
Other style refer: