title: Wrong number of row with Poi
body: <p>I'm working with apache poi and now I have the following trouble. I'm including apache poi in my project in this way:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
          &lt;version&gt;3.7&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Now my problem is that I'm not able to get a correct number of rows, for example I have two files (<strong>Source file</strong> and <strong>UploadFile</strong>). The uploadFile is made select all in the Source file and paste all in the uploadFile. In that case  the following snippet of code print <strong>65535</strong></p>
  
  <pre><code>XSSFSheet firstSheet =  (XSSFSheet) wbUploaded.getSheetAt((short)0); //Foglio Luce
   System.out.println(firstSheet .getLastRowNum());
  
  //Read the sheet
  for(Row row : sheetLuce){
          //Do something
  }
  </code></pre>
  
  <p>Also if my file is the following:</p>
  
  <p><img src="https://i.stack.imgur.com/Dspl8.png" alt="enter image description here"></p>
  
  <p>I understood that the problem depends from the way to make the file, why if I instead to select,copy and  paste all, I select (on Source file) only the filled row and I copy them in the upload filethe number of rows is printed correctly. Now I want to ask you like poi manage the number of rows? </p>