// 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 = cell. getstyle ();
// 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;
// Apply the border styles to the cell
Cell. setstyle (style );
// Saving the Excel file
Workbook. Save ("C: \ book1.xls ");
Information from: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/adding-borders-to-cells.html