OOPS!
Never mind I just forgot some quotes

code:
$IE.Document.getelementbyid("4006index").value = $val  

Sorry