Select dropdown menu in website using libreCalc macro

asked 2017-08-17 09:21:46 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

The coding for select drop-down menu in website Option VBASupport 1

    Sub dropdown()
       URL = ""
         Dim propertytype As Object

      Set ie = CreateObject("InternetExplorer.Application")
       ie.Visible = "True"
     ie.Navigate URL
     Do While ie.ReadyState <> 4
        Set html=ie.document.body

           Set propertytype = html.getElementsByTagName("select")
              MsgBox propertytype.Length
         Set pr=propertytype(4).getElementsByTagName("option")

         MsgBox pr.Length

        For i=0 To pr.Length-1
           MsgBox pr(i).innerText

         If (InStr(pr(i).innerText,"Industrial")>0) Then


        Exit For

        End If


         Set  submitlink = html.getElementsByClassName("btn btn-large btn-block btn-darkgray")
         For Each submit In submitlink
         if(submit.innerText="Search") Then
                 ie.Navigate submit
            Do While ie.ReadyState <> 4
        Exit For
         End If

       End Sub

Here " pr.SelectedValue()="True"" step is not executed. I don't know how to select property type. If anyone knows that execution method, kindly shared to me.

edit retag flag offensive close merge delete