Not to ask a silly question, but...
Since this code will never work in any browser except MSIE, why not code it in VBScript instead of JScript?
Then your code conversion is nearly painless.
Code:
<script type="text/vbscript">
Sub ExportTOExcel()
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
Set oSheet = oBook.Worksheets(1)
Dim j ' As Long (VBScript is untyped, like JS)
Dim lngCol ' As Long
Dim lngRow ' As Long
Dim Field ' As Object
rs.MoveFirst
lngRow = 1
With oSheet
Do While Not rs.EOF
lngCol = 0
For Each Field In rs.Fields
lngCol = lngCol + 1
.Cells(lngRow, lngCol) = Field.Value
Next
lngRow = lngRow + 1
rs.MoveNext
Loop
End With
oBook.SaveAs "C:\Book5.xls"
Workbooks.Open "C:\Book5.xls" ' ??? not sure about this one
End Sub
</script>