Results 1 to 10 of 10

Select option in HTML drop down list

Threaded View

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    6

    Select option in HTML drop down list

    Hi all, this has been puzzling me for a day. What I want to do is select other options in IE html drop down list. But somehow the other methods I read online doesn't work with my situation. I got either "Variable or Block Variable not set yet" or "Property or Method doesn't apply" errors. The following is the VBA code I have so far:

    Sub IE_Auto()
    
    Dim IE As Object
    Dim IE_Object As Object
    Dim IE_Element As Object
    Dim IE_Select As Object
    Dim IE_Value As Object
    Dim i As Integer
    
    
    Set IE = CreateObject("INTERNETEXPLORER.APPLICATION")
    IE.navigate "my web address"
    IE.Visible = True
    
    Do While IE.Busy: DoEvents: Loop
    Do While IE.readyState <> 4: DoEvents: Loop
    
    Set IE_Object = IE.document.getElementsByTagName("input")
    
    i = 0
    Do While i < IE_Object.Length
        If IE_Object(i).Name = "username" Then
            IE_Object(i).Value = "my username"
        ElseIf IE_Object(i).Name = "password" Then
                IE_Object(i).Value = "my password"
        ElseIf IE_Object(i).Type = "image" Then
                IE_Object(i).Click
                Exit Do
        End If
        i = i + 1
    Loop
    
    Do While IE.Busy: DoEvents: Loop
    Do While IE.readyState <> 4: DoEvents: Loop
    
    ******************************
    This is where I need your help 
    ******************************
    
    End Sub
    and the following is html code of the web page:

    HTML Code: 
    I tried IE.document.getElementByName("dxr_report").Value = "file2" to choose the file2 but failed
    I also tried IE.document.all.Item("dxr_report").Vaule = "file2", doesn't work either.

    Any Idea? Please help! Thanks in advance
    Last edited by JohnsonJiang; 04-15-2014 at 01:35 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 02-07-2014, 12:49 AM
  2. [SOLVED] If I select an option from a drop-down in 1 cell, how do i get it to display specific info
    By Posthuman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2012, 01:45 PM
  3. Can only select a drop down option once
    By davidstokes in forum Excel General
    Replies: 27
    Last Post: 02-22-2012, 09:55 AM
  4. Replies: 3
    Last Post: 02-02-2012, 12:18 PM
  5. Replies: 5
    Last Post: 10-27-2005, 01:55 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