IE. Document.items.all does not work hta
<p>I am making a tool for work that generates a new project item on our sharepoint.
On the sharepoint we have a form that needs to be filled in and to identify the textfields of the form I use the  <code>IE.Document.All.Item("id").value=value</code> command.</p>

<p>It works in a separate vbs file, but when I try to launch it from hta it blocks at the <code>IE.Documents.All.item</code> command. Does anybody knows how to solve this?</p>

<p>The code looks like the following (language: vbscript):</p>

<p></p>

<pre><code>Sub SendProjectData
   Set IE = CreateObject("InternetExplorer.Application") 
   set WshShell = CreateObject("WScript.Shell")  
   IE.Navigate "https://sharepointpage" 
   IE.Visible = true
   sleep1 6000 'external defined sleep command'

   IE.Document.All.Item("projectid").Value = "projectname" 
   WshShell.AppActivate "IE" 
   WshShell.SendKeys "{ENTER}"
End Sub
</code></pre>