Excel Interop - Draw All Borders in a Range

后端 未结 7 1385
春和景丽
春和景丽 2020-12-17 18:29

I see from Microsoft\'s documentation that I can access the particular border edges of a cell using the \'xlBordersIndex\' property and for example set the border style for

相关标签:
7条回答
  • 2020-12-17 19:06

    Why not to do simply:

    Excel.Range tRange = xlWorkSheet.UsedRange;
    tRange.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;
    tRange.Borders.Weight = Excel.XlBorderWeight.xlThin;
    

    Note: apply border after the row and cell (range) filled with data to get range simply using function .UsedRange()

    0 讨论(0)
提交回复
热议问题