mercredi 21 mars 2018

Intraction With WebPage VBA

I'm creating a code that allow me to open a specific site and enter value in element with name searchByTagName=searchByTRSMP and then Type search to load the new window

But the problem that button search doesn't have a TagName or IdName only this

<td width="13%" align="center" rowSpan="1" colSpan="1">
   <input name="" onclick="Javascript:document.forms[0].submit();return false;" type="image" srx="/cmh/cmh/xxxxxx" border="0"></input>

Anyone Can Light me on Can i press that button with only those information

this Mycode :

Sub ToComb()
 Dim ie  As Object
 Dim itm As IHTMLElement

 Set ie = CreateObject("InternetExplorer.Application")
 ie.Visible = True
 ie.navigate "http://icc- 
 cadb.eu.airbus.corp:8087/cmh/consultation/preSearchTRSTDMAS.do? 
 clearBackList=true&CMH_NO_STORING_fromMenu=true"
  While ie.Busy Or ie.readyState <> 4: DoEvents: Wend

  Set itm = ie.document.getElementsByName("searchByTRSMP")(0)
   If Not itm Is Nothing Then itm.Value = "k20734"
   Set Doc = ie.document


    Set tags = ie.document.getElementsByTagName("")
    For Each tagx In tags
     If tagx.Value = "Next" Then
     tagx.Click
    Exit For
   End If
 Next
End Sub




Aucun commentaire:

Enregistrer un commentaire