Hi All,

Hopefully someone has run into this, i searched the forum but could not find what i was looking for.

Trying to automate a web submission using the following code:

.Document.getElementsByName("Submit").Click
It works perfectly when you have a normal form element, however the form i am trying to use has the submit button as follows:

<script type="text/javascript">
document.write('<br><input type="submit" name="Submit" value="Submit"><br/><br/>');
</script>
Any ideas?

Thanks,
Carlo

FYI - below is the code in full:

Sub Test()
 
Set objIE = CreateObject("InternetExplorer.Application")
name = InputBox("Enter Name")
 
With objIE
.Visible = True
.Navigate "webpage here"
 
Do While .Busy Or .ReadyState <> 4
DoEvents
Loop
 
 Set what = .Document.getElementsByName("name")
 what.Item(0).Value = offRef

.Document.getElementsByName("Submit").Click
 
Do While .Busy Or .ReadyState <> 4
DoEvents

Loop

End With
Set objIE = Nothing
 
End Sub