title: How to fill rows color in excel in c#
body: <p>I want to fill color row by row in excel. I have a one datatable and include integer data. 
  eg
  dt3
  1
  2
  3</p>
  
  <p>I want to fill row color if dt3 data and excel row number. how to do it. becuase of This code is does not work.</p>
  
  <pre><code> if (dt3.Rows.Count &gt; 0)
          {
              Microsoft.Office.Interop.Excel.Application excelFileObject = new Microsoft.Office.Interop.Excel.Application();
              Microsoft.Office.Interop.Excel.Workbook workBookObject = null;
              workBookObject = excelFileObject.Workbooks.Open(FileTxt2.Text, 0, false, 5, "", "", false,
         Microsoft.Office.Interop.Excel.XlPlatform.xlWindows,
         "",
         true,
         false,
         0,
         true,
         false,
         false);
              Excel.Sheets sheets = workBookObject.Worksheets;
  
              // get the first and only worksheet from the collection of worksheets
              Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
  
              Excel.Range usedRange = worksheet.UsedRange;
  
              Excel.Range rows = usedRange.Rows;
              int c = 0;
              for (int k = 0; k &lt; dt3.Rows.Count-1; k++)
              {
                  foreach (Excel.Range row in rows)
                  {
                      c++;
                      if (c==Convert.ToInt32(dt3.Rows[k]["rownum"].ToString()))
                      {
                          row.Interior.Color = Excel.XlRgbColor.rgbBlue;
                      }
                  }
  
              }
  
              foreach (Process proc in Process.GetProcessesByName("EXCEL"))
              {
                  proc.Kill();
              }
          }
  </code></pre>