title: How to name a new Excel sheet I made and place it at the end of all the sheets?
body: <p>I figured out how to make a new Excel sheet in C#.
  And I do it this way:</p>
  
  <pre><code>private static Microsoft.Office.Interop.Excel.ApplicationClass appExcel;
  appExcel.Worksheets.Add();
  </code></pre>
  
  <p>But I have no idea how to give a name to the Excel sheet I made, nor how to place it at the end instead of the beginning.</p>
  
  <p>I tried this:</p>
  
  <pre><code>sheet1 = appExcel.Worksheets.Add();
  sheet1.name = "test";
  </code></pre>
  
  <p>But this didn't work.
  I also looked in the Add function, but I can NOT fill the name in this way: <code>appExcel.Worksheets.Add("test");</code></p>
  
  <p>My code:</p>
  
  <pre><code>excel_init("C:\\Users\\me\\Desktop\\excel2.xlsx");
  
  private static Microsoft.Office.Interop.Excel.ApplicationClass appExcel;
          private static Workbook newWorkbook_First = null;
          private static _Worksheet objsheet = null;
  
  static void excel_init(String path)
  {
      appExcel = new Microsoft.Office.Interop.Excel.ApplicationClass();
  
      if (System.IO.File.Exists(path))
      {
          // then go and load this into excel
          newWorkbook_First = appExcel.Workbooks.Open(path, true, true,5); // does NOT make 5 excel sheet???
          objsheet = (_Worksheet)appExcel.ActiveWorkbook.ActiveSheet;
      }
      else
      {
          try
          {
              appExcel = new Microsoft.Office.Interop.Excel.ApplicationClass();
              appExcel.Visible = true;
              newWorkbook_First = appExcel.Workbooks.Add(1);
              objsheet = (Microsoft.Office.Interop.Excel.Worksheet)newWorkbook_First.Sheets[1];
          }
          catch (Exception e)
          {
              Console.Write("Error");
          }
          finally
          {
          }
      }
  }
  </code></pre>