Apple Script, Javascript: fill text filed (web form) with data from clipboard
Instead of copying the cell text to the clipboard, save it in a variable and then apply it to the form.

Here's a helpful tutorial that will give you the answer, step by step.

The code would be very similar to yours, using the variable:

tell application "Safari"
        do JavaScript "  document.getElementById('" &amp; IdVar &amp; "').value ='" &amp; theCellValue &amp; "';" in document 1
end tell 


To set the variable form Excel use this:

tell application "Microsoft Excel"
        set CellValueX to (value of cell ColX of row RowX)
end tell


And, of course, wrapt it all in a repeat loop.  

I hope this helps.