user2903358
user2903358

Reputation: 11

ClosedXML.Excel.XLCell Verify if Cell have Bold Properties

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

Upvotes: 1

Views: 5761

Answers (1)

Tim Hutchison
Tim Hutchison

Reputation: 3633

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.

Upvotes: 2

Related Questions