A Border object represents a border around a cell or area of cells.

[DefaultMember("Item")]
 public sealed class Border
<DefaultMember("Item")> _
	Public NotInheritable Class Border

To set a border around a single cell, set the Border.Color and Border.Style of a Border object retrieved through the cell's Style:

cellB2.Style.Border.Style = Border.LineStyle.Thick;
cellB2.Style.Border.Color = Palette.SystemColor.Blue;

You can also define part of a cell's border using Border.Item(Border.Part):

cellB2.Style.Border[Border.Part.Outline].Color = Palette.SystemColor.Blue;

To return a Border object for an Area, use Area.BorderAround.


          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          Worksheet ws = wb[0];
          Area a = ws.CreateArea(4, 4, 15, 6);
          Border b = a.BorderAround;
        

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim ws As Worksheet = wb(0)
          Dim a As Area = ws.CreateArea(4, 4, 15, 6)
          Dim b As Border = a.BorderAround
        

Name

Description

Color

Style

Name

Description

Item(Border.Part)

Name

Description

LineStyle

Part