Return to Snippet

Revision: 69385
at June 10, 2015 09:24 by billi8324


Initial Code
public virtual void ClearThickBorderAround(Range cells)
        {
            Excel.Borders borders = cells.Borders;
             borders[Excel.XlBordersIndex.xlDiagonalUp].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
             borders[Excel.XlBordersIndex.xlDiagonalDown].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
             borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
             borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
             borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
             borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
        }

Initial URL
http://www.nullskull.com/faq/1893/how-to-draw-and-clear-a-border-around-a-cell-or-range-of-cells.aspx

Initial Description
remove border in excel from C#

Initial Title
How to draw and clear a border around a cell or range of cells from C#

Initial Tags
excel

Initial Language
C#