I\'m trying to ensure that an excel file passed to my application is opened in it\'s own window rather than an existing Excel instance. Is there a way of telling the Proces
Try the following.
Process process = new Process();
Process.Start("Excel.exe", myExcelFile);
Other option is, if you use Interop (i.e. Microsoft.Office.Interop.Excel.dll
), you can do it as follows. This will always open the file in a new instance.
Excel.Application excelApp = new Excel.Application();
excelApp.Visible = true;
string workbookPath = (@"C:\Sample.xlsx");
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath,
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);