title: Write on two different worksheets dosen't work excel 2007
body: <p>I have a problem, I need to write some information on an excel.</p>
  
  <p>I can write correctly on one of the two worksheets ("worksheet"), and with the other ("worksheet2"), it doesn't write anything and I don't know why. All the process is the same but it doesn't write anything. </p>
  
  <p>I put my code below, hope it helps:</p>
  
  <pre><code>var excelApp = new Microsoft.Office.Interop.Excel.Application();
          excelApp.Workbooks.Open(destFile);
          Microsoft.Office.Interop.Excel.Worksheet worksheet = excelApp.Worksheets.get_Item(2);
          Microsoft.Office.Interop.Excel.Worksheet worksheet2 = excelApp.Worksheets.get_Item(1);
          excelApp.Visible = false;
  
          var data = new object[numRows, numColumns];
          int contadorMedidas = 0;
          //int primeraVez = 0;
          for (int i = 1; i &lt;= numRows; i++)  // assuming the data starts at 1,1
          {
              for (int j = 1; j &lt;= numColumns; j++)
              {
                  if (contadorMedidas &lt; contents.Count)
                  {
                      worksheet.Cells[i, j] = contents[contadorMedidas];
                      contadorMedidas++;
                  }
              }
          }
  
          //Escribir en la hoja de pautas el nombre y los valores de codigo y plano
          //Codigo
          worksheet2.Cells[2, 5] = codigo;
          //Plano
          worksheet2.Cells[3, 4] = plano;
          //Trabajador
          worksheet2.Cells[6, 2] = cbxWorker.Text;
          //Si es BR, hay que añadir un código extra:
          if (br)
          {
              for (int i = 0; i &lt; numRows; i++)
              {
                  worksheet2.Cells[8 + i, 6] = "7525SI-0203-FA"; 
              }
          }
  
          excelApp.Quit();
  </code></pre>