从文件加载 Excel 文件并更新内存中的单元格值

Load Excel File From a file and Update Cells Values in Memory

基于这篇文章:Insert text into a cell in a spreadsheet document

我想在内存中加载一个 Excel 文件并更新一些单元格值并将其作为下载附件发送给客户端。

我知道使用 StreamOpen 方法有重载,但我不知道如何将 Excel 文件加载到它。

如何从文件加载 Excel 文件并更新内存中的单元格值?

这篇 link 中的文章详细解释了何时以及如何从流中打开 Excel 工作簿:https://msdn.microsoft.com/en-us/library/office/ff478410.aspx

总结:Open 方法有一个特殊的重载,它接受一个 Stream 对象和一个布尔值(是否可以编辑 Excel 文件)。