private void GetRangeText()
{
Excel.Application app = new Excel.Application();
app.Visible = true;
string filename = @"E:\CH\aa.xlsx";
Excel.Workbook wb = app.Workbooks.Open(Filename: filename, ReadOnly: true);
Excel.Worksheet sht = wb.Worksheets["Sheet1"];
Excel.Range rng = sht.Range["A2:D32"];
object[,] arr = rng.Value2;
List<string> strRows = new List<string>();
for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
{
List<string> strCols = new List<string>();
for (int j = arr.GetLowerBound(1); j <= arr.GetUpperBound(1); j++)
{
strCols.Add(arr[i, j].ToString());
}
strRows.Add(string.Join(",", strCols.ToArray()));
}
wb.Close();
string msg = string.Join(Environment.NewLine, strRows.ToArray());
MessageBox.Show(msg);
MyCommon.WriteLog(msg);
//MyCommon.FillDtToWorksheet(app, GetDqRqDiffs());
app.Quit();
}