title: ActiveXObject Number of rows counter
body: <p>I have this piece of code: </p>
  
  <pre><code>    function GetData(evt){
          var adresses = new Array();
          var j = 0;
          var excel = new ActiveXObject("Excel.Application");
          var fil = document.getElementById("file");
          var excel_file = excel.Workbooks.Open(fil.value);
          var excel_sheet = excel.Worksheets(1);
  
          for(var i=2;i&lt;500;i++){
              var morada = excel_sheet.Range("E"+ i );
              var localidade = excel_sheet.Range("C"+ i );
              var pais = excel_sheet.Range("A"+i);
              adresses[j] = (morada + ", " + localidade + ", " + pais);
              j++;
          }
          for(var k = 0; k&lt;j; k++) {
              codeAddress(adresses[k]);
          }
      }
  </code></pre>
  
  <p>It receives an excel file and processes the data like I want. The thing is, it is very hard coded. </p>
  
  <p>For instant, in this for:</p>
  
  <pre><code>for(var i=2;i&lt;500;i++)
  </code></pre>
  
  <p>I am using 500, but I would like to use the number of rows in the sheet. I have already tried a few things like rows.count and whatever and I gave some alerts to see the results, but I just can't find the one who tells me the number of rows.</p>
  
  <p>Anyone know how to do it? </p>