I want to add bold font style to an existing striked out text part, but the IsBold flag resets the IsStrikeout flag of the cell font.
It seems to me that it is an bug, isn’t it?
If I turn around the calls, so that the bold flag is set first and the strikeout flag is set at last, it works fine, but I have to keep the existing format style.
I have written a little console application that explains the failure:
static void Main(string args)
var workbook = new Workbook();
var worksheet = workbook.Worksheets;
worksheet.Name = "Test";
worksheet.Cells["A1"].Value = "Test combined font style bold and strikeout";
// First testcase: first call sets the IsBold property, second call sets the IsStrikeout property
// this is what i have expected.
var cell = worksheet.Cells["A2"];
var text = "Bold StrikethroughBold Bold";
cell.Value = text;
cell.Characters(0, text.Length).Font.IsBold = true;
cell.Characters(5, "StrikethroughBold".Length).Font.IsStrikeout = true;
// Second testcase: just turn around the call sequence of IsStrikeout and IsBold
var cell2 = worksheet.Cells["A3"];
var text2 = "Bold StrikethroughBold Bold failed";
cell2.Value = text2;
cell2.Characters(5, "StrikethroughBold".Length).Font.IsStrikeout = true;
cell2.Characters(0, text2.Length).Font.IsBold = true;
workbook.Save("Test Bold Bug.xlsx", SaveFormat.Xlsx);
Thank you for your help