I think to add it as a function in the script you need to make an excel ODBC connection string (ie. instead of importing using the Table Files button). Think this thread has instructions for that.
If not, add a new column to your spreadsheet and include the excel ROW() function in there.
You could just use rowno() in your qlikview script.
If your rows start on row 4, just use something like rowno()+3 as excel_row_number
This of course assumes that Qlikview loads in order which I think it does but haven't ever really tested
Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.