I am doing an internet search from VBA, and at some point I have a string
Set valueResult = currPage.getElementById("rg_s").getElementsByTagName("IMG")
where is currPagedeclared asHTMLDocument
and I wonder how Dim valueResultto achieve:
- IntelliSense Results (vba autocomplete)
- Better lead time (using a specific type, not the default type
Variant)
When I look at the Locals window, they tell me what Setgives it
DispHTMLElementCollection, but this is not an option when I am Dim. I read that it getElementsBy*actually returns Node Listas opposed to an array, so I try to follow this prospectus, but cannot find anything specific to VBA.
So how can I declare it? - At the moment, I just got it Dim valueResult As Object, but this is hardly better than Variantit does not give IntelliSense invitations.
NB. I have a Microsoft HTML Object Library marked
source
share