Change Border in Excel left,right,bottom and top
Posted
by
Le Viet Hung
on Stack Overflow
See other posts from Stack Overflow
or by Le Viet Hung
Published on 2012-12-11T09:57:38Z
Indexed on
2012/12/11
11:03 UTC
Read the original article
Hit count: 514
Firstly i changed color borders of my sheet to white, because i want to have a white sheet. Then i made some headers and want to make border around it. The Problem is it made borders between the values in header but top, down are not seenable.
My code:
xlWorkSheet5.Columns.Borders.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White); // Color Sheet5 to white, BusLoad
xlWorkSheet5.Columns.NumberFormat = "@";
Excel.Range rng = (Excel.Range)xlWorkSheet5.get_Range("A7","J7");
rng.RowHeight = 25.5;
rng.BorderAround2(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlHairline, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
rng.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;
rng.Borders.Weight = 1d;
rng.Font.Bold = true;
rng.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
rng.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.LightGray);
© Stack Overflow or respective owner