title: Index goes out of range when trying to read large excel file
body: <p>Hello i am trying to create a file that reads from a excel file 125000 ids and usernames which have to be delimited, create tokens based on that and then creating confirmations links. The problem is that at a certain point in time (after more than 30 000 iterations) the index goes out of range for no concrete reason.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data;
  using System.IO;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using ExcelDataReader;
  using Excel = Microsoft.Office.Interop.Excel;
  
  namespace CoRegApp
  {
      public class Excel_Creation
      {
          static string[] tokens;
  
          string emailConfirmationLink;
          public List&lt;string&gt; EmailsList = new List&lt;string&gt;();
          public List&lt;string&gt; userList = new List&lt;string&gt;();
          //Create a variable of the token date
  
          public Excel_Creation() { }
  
          public void readExcel()
          {
              string filepath = "batch2.xlsx";
              var tokenDate = DateTime.Now.AddDays(4).Date;
              using (FileStream stream = File.Open(filepath, FileMode.Open, FileAccess.Read))
              {
                  using (IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream))
                  {
                      DataSet result = excelReader.AsDataSet();
                      DataTable firstTable = result.Tables[0];
  
                      //StringBuilder sb = new StringBuilder();
                      foreach (DataRow dr in firstTable.Rows)
                      {
                          object[] arr = dr.ItemArray;
                          for (int i = 0; i &lt; arr.Length; i++)
                          {
                              string input = ((Convert.ToString(arr[i])));
                              if (!string.IsNullOrWhiteSpace(input))
                              {
                                  tokens = input.Split(';');
                                  for (i = 0; i &lt; 1; i++)
                                  {
                                      string token = EncryptionHelper.CreateToken(tokens[0], tokens[1], tokenDate);
                                      emailConfirmationLink = "https://blablaconfirmation/Validate?token=" + token + "&amp;blablavalidation2";
                                      EmailsList.Add(emailConfirmationLink);
                                      userList.Add((Convert.ToString(arr[i])));
                                      Console.WriteLine(emailConfirmationLink);
                                  }
                              }
  
                              //tokens =().Split(';'));
                          }
                      }
                      excelReader.Close();
                  }
              }
          }
  
          public void MapToExcel()
          {
              //start excel
              Excel.Application excapp = new Microsoft.Office.Interop.Excel.Application();
  
              //if you want to make excel visible 
              excapp.Visible = true;
  
              //create a blank workbook
              var workbook = excapp.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
  
              //Not done yet. You have to work on a specific sheet - note the cast
              //You may not have any sheets at all. Then you have to add one with NsExcel.Worksheet.Add()
              var sheet = (Excel.Worksheet)workbook.Sheets[1]; //indexing starts from 1
  
              //now the list
              string cellName;
              int counter = 1;
              foreach (string item in EmailsList)
              {
                  cellName = "B" + counter.ToString();
                  var range = sheet.get_Range(cellName, cellName);
                  range.Value2 = item.ToString();
                  ++counter;
              }
  
              string cellName2;
              int counterB = 1;
              foreach (string item in userList)
              {
                  cellName2 = "A" + counterB.ToString();
                  var range = sheet.get_Range(cellName2, cellName2);
                  range.Value2 = item.ToString();
                  ++counterB;
              }
          }//end of mapping method
      }
  }
  </code></pre>