I've used the Open XML SDK 2.0 to create a new spreadhsheet and save to a users folder. i want to be able to open this automatically after saving. The file is in the xlsx format.
I tried
SpreadsheetDocument.Open(fileName, true);
This isn't working at all. I'd like the code to open the file in whatever version of excel the user has - 2003, 2007 and 2010 (Assumption: 2003 will have the compatibility pack installed)
If excel is set as the default viewer for xls files on the system you can open the file using Process class:
System.Diagnostics.Process.Start("myFile.xls");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With