![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way to save a dynamically created Excel workbook to a Memory stream? There are no overloads in the Save method to save to a stream. I want to create a web service that will dynamically generate an Excel file, but do not want to use a temporary file for each call. I cannot get the stream as it says the interface is not serializable. Is there any way to do this? Is there a way to find out if the COM object supports IPersistFile or anything? Thanks in advance. Levi |
#3
| |||
| |||
|
|
On Dec 18, 6:08 pm, leviw <skankwilson... (AT) gmail (DOT) com> wrote: Is there a way to save a dynamically created Excel workbook to a Memory stream? There are no overloads in the Save method to save to a stream. I want to create a web service that will dynamically generate an Excel file, but do not want to use a temporary file for each call. I cannot get the stream as it says the interface is not serializable. Is there any way to do this? Is there a way to find out if the COM object supports IPersistFile or anything? Thanks in advance. Levi Well, I haven't gotten much further. I did see that it supports the IPersistStorage interface (the workbook does). I am using C# for this, by the way. I _should_ be able to instantiate an IStorage interface using the IPersistStorage::InitNew method, and from there call IPersistStorage::Save, and then use the IStorage interface to open up a stream that I can get into a byte array, right? Has anyone had any luck with this, or has anyone worked with COM interop like this before? I've defined these interfaces in C#, but when I try to call IPersist.InitNew(pStg), pStg is still set to it's initial value of NULL. Any help/insight would be greatly appreciated. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |