Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application, both ASP.NET web sites and Windows Forms application.

Fri Dec 31, 2010 9:33 am

Hello, i was just wondering if someone knew the code to put a border around a range of cells

Thanks very much

Justin~

justinx1016
 
Posts: 4
Joined: Fri Dec 24, 2010 1:21 am

Fri Dec 31, 2010 10:09 am

Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["B2"].Text = "Home page";
sheet.Range["B2"].Borders.LineStyle = LineStyleType.Thin;
sheet.Range["B2"].Borders[BordersLineType.DiagonalDown].LineStyle = LineStyleType.None;
sheet.Range["B2"].Borders[BordersLineType.DiagonalUp].LineStyle = LineStyleType.None;
sheet.AutoFitColumn(2);
workbook.SaveToFile("Sample.xls");
System.Diagnostics.Process.Start("Sample.xls");


8)
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.XLS

cron