You are using the InternetExplorer object direct access. This gives you access to the IE Object Model. So you can directly call objects in a web document. There isn't great documentation on how to do this so it takes trial and error to get the syntax correct.
Make sure you have the reference to "Microsoft Internet Controls" defined in your
VB project.
You can view the Object reference using the Object Browser {F2}. View Class WebBrowser
Member of
SHDocVw
WebBrowser Control
To get the object names in your web document use "View Source" then get the class names for the Enter button and any other controls you want to activate from your code.
This works with Internet Explorer. Your also using IE so it should work.
Notice in this example it has a Frame 'compliance1'. If you do not have to contend with frames you would leave the frame part out. You'll have to "View Source" to get your control names, Form Name, Doc name, and doc structure of your html document to call the objects in your code. The controls I'm interacting with in this code are the textbox ".search_textbox" and button ".search_button" to enter a value and click the button.
Code:
Sub SearchCompliance()
Dim shWin As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer
Dim codeArray As Variant
For Each IE In shWin
Set Doc = IE.Document
If TypeOf Doc Is HTMLDocument Then
DocTitle = Doc.Title
If DocTitle = "Compliance" Then
bCompliance = True
Exit For
End If
End If
Next
If Not bCompliance Then
MsgBox "Please activate the Compliance Webpage you wish to Search."
Exit Sub
End If
strSearch = Cells(5, 10)
' Activate the IE Browser Window
IE.Visible = True
' Send code string then Click the Search Button
With IE.Document.frames("compliance1").Document.form1
.search_textbox.Value = strSearch
.search_button.Click
End With
End Sub