+ Reply to Thread
Results 1 to 3 of 3

Setting Drop Down In Internet Explorer

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Salt Lake, UT
    MS-Off Ver
    Excel 2003
    Posts
    2

    Setting Drop Down In Internet Explorer

    Hi!

    I'm fairly new to VBA on Excel, and so I may be making an obvious error. There is a table online that I am scrubbing into Excel, and it's coming down ok, but there is a dropdown menu to change the number of items viewed to the maximum instead of the default 10 before scrubbing. Here is my code...


    Option Explicit

    Sub TableExample()
    Dim IE As Object
    Dim doc As Object
    Dim strURL As String
    Dim objCollection As Object
    strURL = Range("Calculator!T47")

    Set IE = CreateObject("InternetExplorer.Application")
    With IE
    '.Visible = True
    .navigate strURL
    Do Until .ReadyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set objCollection = IE.document.getElementsByTagName("ob_iDdlob_Grid1PageSizeSelectorTB")
    objCollection() = "100"
    Application.Wait Now + TimeValue("00:00:08")
    Do Until .ReadyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set doc = IE.document
    GetAllTables doc

    '.Quit
    End With
    End Sub

    Here is what I can share of the page source...

    The dropdown is linked to a UL...
    <ul class="ob_iDdlICBC" style="min-height:;"><li><b>10</b><i>10</i></li><li><b>15</b><i>15</i></li><li><b>20</b><i>20</i></li><li><b>25</b><i>25</i></li><li><b>50</b><i>50</i></li><li><b>100</b><i>100</i></li></ul>

    It defaults to 10 on the page, I want to set it to 100... according to an element finder I used on the page, the only element that was set to ten already was ob_iDdlob_Grid1PageSizeSelectorTB which is a "text" type. Any ideas? More info needed?

    Thanks for the help!

  2. #2
    Registered User
    Join Date
    12-13-2012
    Location
    Salt Lake, UT
    MS-Off Ver
    Excel 2003
    Posts
    2

    Exclamation Re: Setting Drop Down In Internet Explorer

    Been a couple days--hoping someone has some ideas for me, thanks!

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    What have you tried for the dropdown?

    PS Can you post the code for GetAllTables?
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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