在开始阅读之前,我使用以下代码确定Excel文件的最后一行。如果column1值为空,则它不起作用。有没有办法检查所有行或第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;