开发者

Save workbook into a stream instead of a file

开发者 https://www.devze.com 2023-03-17 21:55 出处:网络
Is it possible (and how) to save an Microsoft Excel workbook into a stream instead of a file? what I have now is:

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

精彩评论

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