title: How to read specific column in excel using c# and get the number of occurrences of different words in that column
body: <p>I want to find the number of occurrences of different words in column H using C# and ignore the null values. Later, I have to display the output in List box. I am using the Microsoft.Office.Interlop.Excel reference to open workbook and access the first worksheet. </p>
  
  <p>I tried the following code :</p>
  
  <pre><code>private void button3_Click(object sender, EventArgs e)
      {
  
          Excel.Application xlApp;
          Excel.Workbook xlWorkbook;
          Excel.Worksheet xlWorksheet;
          object misValue = System.Reflection.Missing.Value;
  
  
          xlApp = new Excel.Application();
          xlWorkbook = xlApp.Workbooks.Open("ABC.xlsx", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
          xlWorksheet = (Excel.Worksheet)xlWorkbook.Worksheets.get_Item(1);
  
  
          Excel.Range bColumn = xlWorksheet.UsedRange.Columns[4, Type.Missing].Columns.Count;
  
  
      List&lt;string&gt; dataItems = new List&lt;string&gt;();
  
      foreach (object o in bColumn)
      {
  
          Excel.Range row = o as Excel.Range;
          string s = row.get_Value(null);
          dataItems.Add(s);
  
      }
      listBox1.DataSource = dataItems;
          xlWorkbook.Close(true, misValue, misValue);
          xlApp.Quit();
  
          releaseObject(xlWorksheet);
          releaseObject(xlWorkbook);
          releaseObject(xlApp);
      }
  </code></pre>
  
  <p>Please help me out with the code and suggest the fastest possible approach as the worksheet contains more than a thousand rows.</p>
  
  <p>Thanks in advance for the help!</p>