javascript - ActiveXObject Number of rows counter -
i have piece of 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<500;i++){ var morada = excel_sheet.range("e"+ ); var localidade = excel_sheet.range("c"+ ); var pais = excel_sheet.range("a"+i); adresses[j] = (morada + ", " + localidade + ", " + pais); j++; } for(var k = 0; k<j; k++) { codeaddress(adresses[k]); } }
it receives excel file , processes data want. thing is, hard coded.
for instant, in for:
for(var i=2;i<500;i++)
i using 500, use number of rows in sheet. have tried few things rows.count , whatever , gave alerts see results, can't find 1 tells me number of rows.
anyone know how it?
try :
excel_sheet.usedrange.rows.count
does works ?
Comments
Post a Comment