Open and use new IE Tab

ryan.gillies

Registered User.
Local time
Today, 16:23
Joined
Apr 8, 2011
Messages
53
Hi all

I've got a whole string of code set up to try and return a set of details from a website that we require on a monthly basis.

To do so I need to read the details on a lot of separate pages, linked to by a main page. I'm trying to open tabs, read the data in the tab, then close it again, but I'm having trouble referencing the new tabs document.

Here's a snippet of the code:

Code:
ie.navigate tabURL, CLng(navOpenInNewTab)
        
        For Each shTab In shWindows
        
            If shTab.LocationURL = tabURL Then
                Call ieLoading(shTab)
                Set ieTab = shTab.Document
                Exit For
            End If
            
        Next shTab
        Set ieColl = ieTab.getElementsByTagName("dd")

On the final line I'm getting the rather frustrating "run-time error '91' object variable or with block variable not set" error... not the first time I've had it, certainly won't be the last! Does anyone have any thoughts as to why?

Many thanks!
 
I resolved this in the end by using two separate instances of internet explorer (so an ie and ie2) and performed actions on both pages rather than continuously opening and closing tabs.

If anybody comes up with something though I'd be interested to hear about it!
 

Users who are viewing this thread

Back
Top Bottom