可以通过NuGet Package Manager安装Free Spire.XLS,实现获取单元格的值以及合并单元格
获取某个单元格的值:
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
//获取单元格A3的值
string value = workbook.Worksheets[0].Range["A3"].Value;
合并多个单元格:
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
//合并单元格A3:B5
workbook.Worksheets[0].Range["A3:B5"].Merge();
workbook.SaveToFile("Merge.xlsx");