Tag Archives: get or set cell style in excel

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:

1. use Cell.Style property

[C#]

cell.Style.Font.IsBold = true;

[VB.NET]

cell.Style.Font.IsBold = True

 2. 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. So why … Continue Reading

Posted in Aspose.Cells Product Family | Tagged , , , ,