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!
Bookmarks