Posted By

billi8324 on 06/10/15


Tagged

excel border


Versions (?)

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


 / Published in: C#
 

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

remove border in excel from C#

  1. public virtual void ClearThickBorderAround(Range cells)
  2. {
  3. Excel.Borders borders = cells.Borders;
  4. borders[Excel.XlBordersIndex.xlDiagonalUp].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  5. borders[Excel.XlBordersIndex.xlDiagonalDown].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  6. borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  7. borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  8. borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  9. borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  10. }

Report this snippet  

You need to login to post a comment.