SyntaxFix
Write A Post
Hire A Developer
Questions
Excel.Range last = sheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell, Type.Missing); Excel.Range range = sheet.get_Range("A1", last);
"range" will now be the occupied cell range