title: how to get cell background color of excel using C#?
body: <p>I want to retrieve the background color of cell of excel using c# but I just can't find a way to do it</p>
  
  <ol>
  <li><p>which library shall I use ? <a href="https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.aspx" rel="noreferrer"><code>microsoft.office.tools.excel.workbook.aspx</code></a> or <a href="https://msdn.microsoft.com/library/microsoft.office.interop.excel(v=vs.140).aspx" rel="noreferrer"><code>microsoft.office.interop.excel</code></a> ? what's the differents?</p></li>
  <li><p>I have tried following code but get no luck:</p>
  
  <pre><code>using Excel = Microsoft.Office.Interop.Excel;
  
  private void button1_Click(object sender, EventArgs e)
  {
      ofd.Filter = "xlsx|*.xlsx|xls|*.xls";
  
      if(ofd.ShowDialog() == DialogResult.OK)
      {
          textBox2.Text = ofd.FileName;
          Excel.Application excel = new Excel.Application();
          Excel.Workbook wb = excel.Workbooks.Open(textBox2.Text);
          Excel.Worksheet ws = wb.Sheets[1];
          Excel.Range xlRange = ws.Cells[0, 0];
          Debug.WriteLine("===" + xlRange.Interior.Color);
      }
  }
  </code></pre></li>
  </ol>