my code:
Excel.Application excelapp = new Excel.Application();
Excel.Workbook`enter code here` excelbook;
string path = "mypath";
excelbook = excelapp.Workbooks.Open(path, 0, False,
5,System.Reflection.Missing.Value,
System.Reflection.Missing.Value,False,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,True, False,
System.Reflection.Missing.Value, False);
Excel.Sheets excelsheets = excelbook.Sheets;
Excel.Worksheet excelsheet = excelsheets[1];
Excel.Range range = excelsheet.UsedRange;
range.SpecialCells(Excel.XlCellType.xlCellTypeLast Cell).Activate();
Int32 newrow = excelapp.ActiveCell.Row + 1;
string newcelladdress = "A" +newrow;
// The Error is here underline .Range
excelsheet.Range(newcelladdress).Value = "New Data";