excel - JavaScript via Cscript Runtime Error - Odd Expected ';' -
i'm writing basic script sake of data entry excel jscript, , i've run bit of roadblock strange error (the returned error isn't strange, moreso how go fixing it).
i'm looking last free row in worksheet checking cells.(i, 8).value see if there 2 consecutive rows empty, break loop retain index i, , perform data entry.
while(!data.atendofstream)//looping find data the 5 digit code found above. { var ts = new string(data.readline()); var t=ts.split(","); if(search==t[0]) { var i; for(i=0; i<wks.usedrange.rows.count; i++) { if(wks.cells(i,11).value==null) { wscript.stdout.writeline("empty @ "+i); break; } } //data entry statements etc... } }
when compiling through cmd, get: microsoft jscript runtime error: expected ';' returned line on if(wks.cells) line, char 4. i'm not sure if bad programming on part, or i'm overlooking...
i'm not sure jscript, know cells(0,11)
shouldn't work because cells base 1 (there no row 0 in excel). so, if try changing code to:
for(i=1; i<wks.usedrange.rows.count; i++)
i believe work. wrong, it's worth shot.
Comments
Post a Comment