Hi,
I’ve created an aspose excel object and at the moment I can save it to an excel format using:
excel1.Save(@“C:\Visual Studio Projects\Test.xls”);
I want to know can I actually open windows Excel with the file from the C# code?
I know there is an Open function but am I correct in saying that only opens a data stream?
Please try this:
ProcessStartInfo psi = new ProcessStartInfo((@“C:\Visual Studio\Projects\Test.xls”);
Process.Start(psi);
Hey,
Thats throwing up a type/namespace error, what namespace do I need to add for Process/Process StartInfo?
Please refer to your MSDN. You can find:
System.Diagnostics.ProcessStartInfo
System.Diagnostics.Process
Apologies I thought the functions were a part of aspose, yep thats working perfectly now thanks!
Hi,
I’ve a little add on to this query I had a while back…
It turns out I don’t actually need to save the Aspose Excel object, after I’m done populating it I just need to open it in an MS Excel window.
Seeing as the code:
ProcessStartInfo psi = new ProcessStartInfo((@“C:\Visual Studio\Projects\Test.xls”);
requires having a saved file to open I’m just wondering is there any way I can open the Aspose Excel object in an MS Excel window without saving it to a file?
Aspose.Excel can save result to memory stream but I also don’t know how to pass the data to MS Excel without saving it to disk.
Did you try this?
excel1.Save(“test.xls”, SaveType.OpenInPlace, FileFormatType.Default, Response);
If your application is a webform application, you can use
excel1.Save(“test.xls”, SaveType.OpenInExcel, FileFormatType.Default, Response);
to open an Excel window without saving the file to disk.
However, if your app is a winform app, I think you have to save it to disk before using MS Excel to open it.