We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Row's Style

How can I set style properties, color, font…, to the entire row as apposed to cell by cell in the row?

You can try this:

Excel excel = new Excel();
Row row = excel.Worksheets[0].Cells.Rows[0];
row.Style.ForegroundColor = Color.Red;

the excel.Worksheets[0].Cells.Rows[0]code does not compile.

‘Aspose.Excel.Cells’ does not contain a definition for ‘Rows’.

Do you use the latest hofix v2.6.1? It's available at

Aspose.Excel is discarded and no more under active development now. It is replaced by Aspose.Cells which contains all the features of its predecessor as well as support for the latest features in different versions of MS Excel. It is much advanced in terms of features and performance when compared with other products. Rich features are available for formatting and setting styles to individual cells, complete row and columns as well. Here is an example to set row style using Aspose.Cells.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET

// Instantiating a Workbook object
Workbook workbook = new Workbook();

// Obtaining the reference of the first (default) worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[0];

// Accessing the "A1" cell from the worksheet
Aspose.Cells.Cell cell = worksheet.Cells["A1"];

// Adding some value to the "A1" cell
cell.PutValue("Visit Aspose!");

// Create a style object
Style style = workbook.CreateStyle();

// Setting the line style of the top border
style.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thick;

// Setting the color of the top border
style.Borders[BorderType.TopBorder].Color = Color.Black;

// Setting the line style of the bottom border
style.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thick;

// Setting the color of the bottom border
style.Borders[BorderType.BottomBorder].Color = Color.Black;

// Setting the line style of the left border
style.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thick;

// Setting the color of the left border
style.Borders[BorderType.LeftBorder].Color = Color.Black;

// Setting the line style of the right border
style.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thick;

// Setting the color of the right border
style.Borders[BorderType.RightBorder].Color = Color.Black;

worksheet.Cells.ApplyRowStyle(0, style, new StyleFlag() { All = true });

// Saving the Excel file

Get more details by following the link below about formatting cells:
Cells Formatting

Download the latest trail version of this product here:
Aspose.Cells for .NET (Latest Version)

A runnable solution containing hundres of ready to run axamples can be downloaded here.