I am trying to input data from Excel workbook to web pages search field and click search button. A lot of different approaches has been tested with success. Current solution gives 424 Error, Object required. Pointing to:
.Document.getElementById("crmGrid_findCriteria").Value = _
Sheets("Other data").Range("A2").Value
HTML for search field:
<input id="crmGrid_findCriteria" title="Search for records" hintlabelid="crmGrid_findHintText" type="text" class="ms-crm-Dialog-Lookup-QuickFind" maxlength="100" tabindex="0" value="">
HTML for Search button:
<img id="crmGrid_findCriteriaImg" src="/_imgs/imagestrips/transparent_spacer.gif" class="ms-crm-ImageStrip-search " imgbase="/_imgs/search" title="Start search" alt="Start search">
Here is structure:
Here is my VBA (link for CRM system so it is not public):
Sub GoToOpport()
'This will load a webpage in IE
Dim ieappIE As InternetExplorerObject
Dim HWNDSrc As Long
Dim elementsSet AsappIE Object= CreateObject("internetexplorer.application")
Set ie = Nothing With appIE
Set ie = New InternetExplorerMedium
ie.Visible = True
ie.Navigate "https://crm.dynamics.com/main.aspx?area=nav_oppts&etc=3&page=SFA&pageType=EntityList&web=true"
With ie
Do
DoEvents
Loop Until ie.ReadyState = READYSTATE_COMPLETE
End With
ie.Document.getElementById("contentIFrame0").contentDocument.getElementById("crmGrid_findCriteria").Value = "hello"
'Unload IE
Set ieappIE = Nothing
End Sub
Error: