Excel工作表select第一行与C#

我想select使用互操作对象的Excel表第一行。 我能怎么做 ?

xlWorkBook = xlApp.Workbooks.Open(directory, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1); range = xlWorkSheet.UsedRange; var List<string> tempList= range[1,*].Value.ToList(); 

我想写下类似的东西。 我怎么写这种情况

尝试:

 xlWorkSheet.Range("A1", "A1").EntireRow.Value; 

Rows属性使用您可以访问特定范围的第一行:

 var firstRow = range.Rows[1]; 

这对我有用。 selectExcel表格的第一行并应用粗体样式

  xlWorkSheet.Cells[1, 1].EntireRow.Font.Bold = true;