开发者

Save workbook into a stream instead of a file

Is it possible (and how) to save an Microsoft Excel workbook into a stream instead of a file?

what I have now is:

using System.Runtime.InteropServices; // Microsoft Excel 14.0 Object Library
.......
workbook.SaveAs(Filename: fileName, FileFormat: XlFileFormat.xlWorkbookNormal);

But both doc开发者_如何学JAVAumentation as intellisense give me no clue how to put this in a stream and write it with a BinaryWriter e.g. to output it via the browser.


Office Automation provides an API to control tge office UI. It does not provide a way to store a workbook to a stream. To do that you need something lower level like a binary writer (POI) or Office Open XML SDK.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜