This project has moved and is read-only. For the latest updates, please go here.

Border Color

Jun 12, 2012 at 8:37 PM

I just started using EPPlus, and it's PHENOMENAL!  Awesome tool!  However, I've been sitting here for about an hour and a half trying to figure out how to change a cell's border color, and I've given up.

Any help?  How in heck do I change the border color of a cell!!

Jun 13, 2012 at 8:48 PM

Something like this...

ws.Cells["B2:B3"].Style.Border.Left.Style=ExcelBorderStyle.Thin;
ws.Cells["B2:B3"].Style.Border.Left.Color.SetColor(Color.Red);

... and the you have to do the same for Right, Top And bottom, if that's what you want.

Jun 14, 2012 at 12:58 AM

FANTASTIC!!! Works beautifully!

Thanks a million for the help and for the tremendous product!

From: JanKallman [email removed]
Sent: Wednesday, June 13, 2012 3:49 PM
To: bill@rebey.com
Subject: Re: Border Color [EPPlus:359351]

From: JanKallman

Something like this...

ws.Cells["B2:B3"].Style.Border.Left.Style=ExcelBorderStyle.Thin;
ws.Cells["B2:B3"].Style.Border.Left.Color.SetColor(Color.Red);
 

... and the you have to do the same for Right, Top And bottom, if that's what you want.