How do I get an Excel range using row and column numbers in VSTO / C#?

后端 未结 9 1955
萌比男神i
萌比男神i 2020-12-05 13:07

I think the question sums it up. Given two integers for row and column or four integers for row and column for the two corners of a range, how do I get a range object for th

9条回答
  •  醉话见心
    2020-12-05 13:50

    you can retrieve value like this

    string str = (string)(range.Cells[row, col] as Excel.Range).Value2 ;
    

    select entire used range

    Excel.Range range = xlWorkSheet.UsedRange;
    

    source :

    http://csharp.net-informations.com/excel/csharp-read-excel.htm

    flaming

提交回复
热议问题