I am using the following code to determine the last row of the Excel file before I start reading. If column1 values are empty then it does not work. Is there a way to check all rows or row 2
//Count number of rows
range = (Excel.Range)xlWorkSheet.Cells[xlWorkSheet.Rows.Count, 1];
//Get directoryname
string directoryname = Path.GetDirectoryName(edifile);
//Remove special characters
string filenameNoExt = RemoveSpecialCharacters(Path.GetFileNameWithoutExtension(edifile));
//Build Unique Guid Filename
csvfile = path + filenameNoExt + "_" + Utilities.GetMyGUID();
//xlUp will move up the worksheet to find the last cell with data.
long lastRow = (long)range.get_End(Excel.XlDirection.xlUp).Row;