1) For windows/desktop applications, we have .NET’s System.Diagnostics.Process.Start() method, but this method obviously takes filePath and not stream as an argument, so this would not be worthwhile. We also have Aspose.Cells.GridDesktop control that does open/display the Excel files from streams, it is Excel like control, see the sample code:
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(“e:\test2\TestBook.xlsx”);
MemoryStream ms = new MemoryStream();
ms.Position = 0;
this.gridDesktop1.ImportExcelFile(ms, false); //Place the GridDesktop on the Win Form and the control will display the Excel spreadsheet.
If you do not like this control, you may try to Google and find some means to view the Excel files directly from streams and not from disks, you need to create your own module and this might demand extensive coding etc. Also, you may try to find some way to write your own pseudo-file system in .NET, somehow mounting this as a disk in Windows, and having it intercept the file open from stream but not sure thought it would be effective much.
2) For web applications, you may use Response object to stream the Excel file as an attachment/inline to the client end, so that the file is directly opened into the client’s Excel/Excel Viewer.
Workbook wb = new Workbook();
//Your code goes here.
byte wbBytes = wb.SaveToStream().ToArray();
currentHttpContext.Response.ContentType = “application/vnd.ms-excel”;
currentHttpContext.Response.AddHeader(“content-disposition”, “attachment; filename=” + “Test.xls”);
currentHttpContext.Response.OutputStream.Write(wbBytes, 0, wbBytes.Length);
Also, you may use Aspose.Cells’s API (using the relevant Workbook.Save() method to response the Excel file to the client to be opened in the streams), see the document on how to save workbooks for your complete reference (see the subtopic: “3. Saving file to Response Object” in the document):
Similarly, we do have Aspose.Cells.GridWeb control that can suit your needs, see the demos:
Hope, this helps.