> 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
[quoted text clipped - 5 lines]
>
> 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.
leviw - 20 Dec 2007 22:07 GMT
> > 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
[quoted text clipped - 16 lines]
> call IPersist.InitNew(pStg), pStg is still set to it's initial value
> of NULL. Any help/insight would be greatly appreciated.
Correct, when I call IPersistStorage.InitNew...I've been able to cast
the workbook as an IPersistStorage. I just can't get any further than
that.