0

Hi i have a XLCell and need to validate if that cell have Bold style.

 IXLCell cell = worksheet.Cell(12, 5);
            if (cell.Style.Font.Bold)
            {
                callFunction();
            }

Open xlsx the cell have the Bold style active. Using c# and closedXml how can i validate if cell have bold style active? Should be with other properties or styles?

Thks in advance

user2903358
  • 1
  • 1
  • 1

1 Answers1

1

cell.Style.Font.Bold is a property with both a get and a set method so you should be able to do the following:

IXLCell = worksheet.Cell(12, 5);
if (cell.Style.Font.Bold == true)
{
    callFunction();
}

Check out the ClosedXML Documentation for more details.

Tim Hutchison
  • 3,483
  • 9
  • 40
  • 76