title: Search For a code in Excel File without Excel Installed
body: <p>I made an application C# that searches for a code entered by the user in an excel file and then it displays some description corresponding to the code.</p>
  
  <p>The excel have file have 2 Columns. One is code one is description. e.g</p>
  
  <pre><code>code  description
  1     hello
  2     this is
  3     a test
  </code></pre>
  
  <p>So if User enters 3. It will return with "a test"</p>
  
  <p>I am using Microsoft.Office.Interop.Excel;</p>
  
  <p>However, it came to my attention that this will only work if you have Excel Installed on your computer. I need something that doesn't require you to have excel installed on your computer.</p>
  
  <p>The code I have for my current program.</p>
  
  <pre><code>using Excel = Microsoft.Office.Interop.Excel;
  
  namespace Excel_Finder
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              label3.Text = "Searching For Code!";
              label3.Visible = true;
              Excel.Application xlApp = new Excel.Application();
              string path = textBox3.Text;
              Excel.Workbook workBook = xlApp.Workbooks.Open(path);
              Excel.Worksheet workSheet = workBook.Worksheets["Sheet1"];
              Excel.Range range = workSheet.Columns[1];//Range of Column A
              Excel.Range findRange;
              string strToFind = textBox1.Text;
              string description;
              findRange = range.Find(strToFind);
              if (findRange is null)
              {
                  label3.Text = "Code " + textBox1.Text + " Does not Exist!";               
              }
              else
              {
                  description = workSheet.Cells[findRange.Row, 2].VALUE;
                  textBox2.Text = description;                             
              }
          }
      }
  }
  </code></pre>
  
  <p>This code works as expected but as I said this does not work if I don't have excel installed. I found some other libraries that does not require excel to be installed but I am not sure how to use them to do this same thing. If someone can provide an example that would be great with any library.</p>
  
  <p>Thanks in advance.</p>