Results 1 to 7 of 7

How to select webpage HTML Input element list item

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    How to select webpage HTML Input element list item

    I have been trying to select a specific value of an Input selector on a webpage, without success
    Below is the code (part of a much larger automation script) to find the input element which is successful. But have tried various input value selection methods with no success.
    A solution would be most welcome

    see also image snippets of html and input screenshots

     ' find & select Released Prices
            Set htmlColl = objInternetPage.getelementsbytagname("input")
            For Each htmlInput In htmlColl
                Select Case htmlInput.ClassName
                    Case "x-form-text x-form-field x-combo-noedit"
                        If htmlInput.Value = "Not released prices" Then
                            Set objInput = htmlInput
                            Exit For
                        End If
                End Select
            Next htmlInput
    
            If objInput Is Nothing Then Stop
            
            ' Input has 2 values - item 0 = Released prices, and item 1 = Not released prices (default value)
            
            ' but cant select the list item
            ' like this
            objInput.selectedindex = 0
            ' or like this
            objInput.parentelement.Children.Item(1).selectedindex = 0
            
            
            ' this allows activation of the dropdown selector arrow
            objInput.parentelement.Children.Item(1).Click
            ' but cant select the list item like this
            objInput.parentelement.Children.Item(1).selectedindex = 0
            
            
            ' tried this to select Released prices - but no success (populates the input with the value, but does not change the input selection to Released prices item)
            objInput.Value = "Released prices"
            objInput.fireevent ("onchange")
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Use VBA to select option from list box on webpage
    By meabrams in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2016, 11:00 PM
  2. NEED HELP: How to code correctly an HTML element to excel vba
    By blackorchids2002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2015, 04:15 PM
  3. Select option in HTML drop down list
    By JohnsonJiang in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-15-2014, 03:28 PM
  4. Replies: 5
    Last Post: 04-11-2014, 03:13 PM
  5. [SOLVED] Parsing HTML element into excel
    By chococ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2014, 05:20 PM
  6. Select Combobox Item With List Item Select
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-22-2011, 02:40 PM
  7. Last list item selected in a Multi-Select list box?
    By Brian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2005, 05:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1