I am trying to get a column, but limiting it to used range...
public static Excel.Application App = new Excel.Application();
public static Excel.Workbook WB;
WB = App.Workbooks.Open("xxx.xls", ReadOnly: true);
var sheet = (WB.Sheets[1] as Excel.Worksheet);
// returns 65536 rows, I want only 82 (used range)
sheet.get_Range("F:F");
sheet.UsedRange.get_Range("F:F").Rows.Count; // 65536
How can I get it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…