我需要在第 5 行第 1 列中插入文本,在第 5 行第 2 列中插入另一个文本...我该怎么做?以下是正在使用并超出范围异常的代码:
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
Excel.Worksheet xlWorkSheet2;
Excel.Worksheet xlWorkSheet3;
Excel.Range oRange;
xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet2 = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
xlWorkSheet2.Name = "The chart sheet";
xlWorkSheet2.Cells[5, 1] = "First Name";
xlWorkSheet2.Cells[5,2] = "Last Name";