title: Coloring Excel sheet cells using C# without Microsoft Office installed?
body: <p>I wrote a program to do this but got an exception saying</p>
  
  <pre><code>Retrieving the COM class factory for component with   
  CLSID {00024500-0000-0000-C000-000000000046}   
  failed due to the following error: 80040154 
  Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
  </code></pre>
  
  <p>How do I resolve this exception and how can I use C# to color Excel sheet cells?</p>
  
  <p>Below is the code:</p>
  
  <pre><code>using Excel = Microsoft.Office.Interop.Excel;
  using System.Reflection;
  using System.Windows;
  using System.Drawing;
  using Microsoft.Office.Interop.Excel;
  using System;
  
  namespace Project32
  {
      public class Class1
      {
          static void Main()
          {
              Application excel = new Application();
              Workbook wb = excel.Workbooks.Open(@"C:\Users\mvmurthy\Downloads\IDBDeviceReport.rdlc");
              Worksheet ws = wb.Worksheets[1];
              ws.Cells[1, 1].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red); 
          }
      }
  }
  </code></pre>