title: Export List to Excel
body: <p>So I have a list of data that I am trying to export to excel. I just want to list it going down column 1 but it refuses. I was originally going to use a foreach loop but i was worried that would slow down my program and i wouldn't be able to use the for loop idea i had. Does anyone have any good ideas to just import this. I feel like it shouldn't be as hard as i am making it. This is what i have done so far. Thanks in advance.</p>
  
  <pre><code>if (dialog == DialogResult.Yes)
  {
      Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
      Workbook wb = excel.Workbooks.Add(XlSheetType.xlWorksheet);
      Worksheet ws = (Worksheet)excel.ActiveSheet;
  
      ws.Cells[1, 1] = "Folder Names";
      for (int row = 0; row &lt;= count; row++)
      {
          ws.Cells [1, row+2] = Namelist;
      }
      excel.Visible = true;
  
  }
  </code></pre>
  
  <p>I want to go sequentially down the list as well. (the code above wont export Namelist, rest works though)</p>
  
  <p>Namelist = list
  int count (it is a counter i started earlier in the program to determine the number of lines of Namelist)</p>