En

Cell.Style property vs Cell.GetStyle/SetStyle method

Since v4.4.2, we add two new methods to format a cell: Cell.GetStyle method and Cell.SetStyle method. So now you can use the following two ways to format a cell: use Cell.Style property [C#] cell.Style.Font.IsBold = true; [VB.NET] cell.Style.Font.IsBold = True use Cell.GetStyle and Cell.SetStyle method [C#] Style style = cell.GetStyle(); style.Font.IsBold = true; cell.SetStyle(style); [VB.NET] Dim style as Style = cell.GetStyle() style.Font.IsBold = True cell.SetStyle(style) You can see that the first approach is easy and straight-forward.
April 10, 2008 · 2 min · Laurence