title: Any idea why I'm getting the error "Column number must be between 1 and 16384"?
body: <p>What my code is trying to accomplish is copying all the cells from one worksheet into another. It is  the simple block</p>
  
  <pre><code>// find the index of the first empty row and column in the dumped file
  int m = 1; while ( !wb.Worksheet(3).Cell(m,1).IsEmpty() ) ++m; 
  int n = 1; while ( !wb.Worksheet(3).Cell(1,n).IsEmpty() ) ++n;
  // copy from dumped file into raw data file
  for (int i = 1; i &lt; m; ++i )
  {
      for (int j = 1; i &lt; n; ++j)
      {
          wb.Worksheet(1).Cell(i,j).Value = wb.Worksheet(3).Cell(i,j).Value;
      }
  }
  </code></pre>
  
  <p>and somehow this is throwing the error </p>
  
  <blockquote>
    <p>Column number must be between 1 and 16384</p>
  </blockquote>
  
  <p>Any idea why that could be? I don't see any infinite loops or anything like that.</p>