Exporting to Excel via memory-stream

  • Thread starter Thread starter magnus
  • Start date Start date
M

magnus

Hi

I´m trying to export a datatable to Excel. So far I have set up a file
dump and can start Excel to read from that file.
Now, my question is this: Since I have a stream, could I convert it to
a MemoryStream, start an Excel process and instruct it to read the
memory stream instead of a filepath.
I do realize that proceses can not normally access another process
recources, but hopefully there is a way around this!

Or is there perhaps another way to do this??
Primary reason for wanting to do this, is that by opening a saved file
from Excel, will not open the Save-dialog when the user saves the file
(unless he/she presses SaveAs).

Thanks,
Magnús
 
I basicly want to open up a new instance of an Excel worksheet and
dump a DataTable into that, then when the users press Ctrl-S the
save-dialog pops up (as the file has not been saved yet).

Currently I'm writing to a file, then starting a new Excel process,
instructing it to read that file.
That, of course, causes some confusion with the users, as they are
saving the file (when pressing Ctrs-S) to the temp directory (never to
be found again :S )

thanks,
Magnús
 
Back
Top