title: Excel open file
body: <p>I'm trying to open an excel file, and that it appears on the screen, but I can't manage to do it... Here is my code so far: </p>
  
  <pre><code>public class PPE_Process {
      public static void EditProcess() {
          PPE_ExcelFiles.Initialize("Excel.Application");
  
          OpenDataDlg = new OpenFileDialog(); 
          OpenDataDlg.Filter = "Cahier PPE|*.xlsx";
  
          if (OpenDataDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK &amp;&amp; OpenDataDlg.FileName != "") {
              PPE_ExcelFiles.OpenPPE(OpenDataDlg);
          }
      }
  }
  
  public class PPE_ExcelFiles {
  
      public static Excel.Application excelApp;
      public static Excel.Workbook ppeWorkbook;
  
      public static void OpenPPE(OpenFileDialog opf) {
          ppeWorkbook = excelApp.Workbooks.Open(opf.FileName);
          ppeWorkbook.Open += new Excel.WorkbookEvents_OpenEventHandler(OpenWorkBook);
      }
  
      public static void Initialize(string labelAppli)
      {
          excelApp = (Excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject(labelAppli);
          excelApp.DisplayAlerts = false; 
      }
  
      private static void OpenWorkBook() {
          excelApp.WindowState = Excel.XlWindowState.xlMaximized;
      }
  }
  </code></pre>
  
  <p>So, have I done something wrong, do I miss something, or is there no way to do it? And tell me if you need more details :)</p>
  
  <p>(By the way, if you see something in my code that can be written in a better way, or I don't know, don't hesitate to tell me, I'm a pretty new coder)</p>
  
  <p>Thank you for your time !</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>That's not a duplicate of " <a href="https://stackoverflow.com/questions/464902/how-to-open-an-excel-file-in-c">How to open an Excel file in C#?</a> ", because in his case, he just wants to open the file, so that he can "work" on it with his code, and I've already done that. I want to do that this file appears on the screen, so that you can work on it manually (I don't know if that's clear, with my english).</p>