日期:2014-05-18 浏览次数:20814 次
for (int i = 1; i < mySheet.Rows.Count; i++) { DataRow dr = dt.NewRow(); for (int j = 1; j < mySheet.Columns.Count; j++) { try { string fla = ((Range)mySheet.Cells[i, j]).Formula.ToString(); Range r = (Range)mySheet.Cells[i, j]; r.Formula = fla; dr[j] = Convert.ToString(r.Value2); } catch { hasCell = false; break; } }