/// <summary>
/// 查找Excel使用的范围地址【对应某块区域】
/// </summary>
/// <param name="sheet"></param>
/// <returns>如:A1:Z8</returns>
public static string GetMinimalUsedRangeAddress(Worksheet sheet)
{
//最简洁获取实际使用范围
var sheetRange = sheet.UsedRange.Address.Replace("$", "");
string address = string.Empty;
try
{
int rowMax = 0;
int colMax = 0;
Excel.Range usedRange = sheet.UsedRange;
Excel.Range lastCell = usedRange.SpecialCells(Excel.XlCellType.xlCellTypeLastCell, Type.Missing);
int lastRow = lastCell.Row;
int lastCol = lastCell.Column;
int rowMin = lastRow + 1;
int colMin = lastCol + 1;
int rr = usedRange.Rows.Count;
int cc = usedRange.Columns.Count;
for (int r = 1; r <= rr; r++)