Good Morning...
Curious if anyone has some experience working with Tabbed Browsing in VBA... I currently have a routine that opens multiple webpages and pulls data into a spreadsheet from those pages. However, I recently came accross some code that will open up the different pages in tabs, as opposed to opening multiple windows at once, and I was trying to modify my code to do the same.
I have gotten it to open my pages successfully in tabs, however the problem I am running into is how to assign each tab to a variable. My original code opened 4 webpages at the same time, and they were identified as such:
Then the code waited for all 4 pages to load, then it would cycle through all four and pull down HTML code:
What I have done so far is moved this line out of my loop:
But then I tried to do
and I get a syntax error. Is there a way to set a tabbed .navigate to a variable so I can refer to it later in the routine?
Curious if anyone has some experience working with Tabbed Browsing in VBA... I currently have a routine that opens multiple webpages and pulls data into a spreadsheet from those pages. However, I recently came accross some code that will open up the different pages in tabs, as opposed to opening multiple windows at once, and I was trying to modify my code to do the same.
I have gotten it to open my pages successfully in tabs, however the problem I am running into is how to assign each tab to a variable. My original code opened 4 webpages at the same time, and they were identified as such:
Code:
Dim IE(4) as Variant
For Var = 1 to 4
Set IE(Var) = IEWindow.Navigate HLink
Next
Code:
For Var = 1 To 4
y = IE(Var).Document.body.innerHTML
'Do something with y
Next
What I have done so far is moved this line out of my loop:
Code:
Set IEWindow = CreateObject("INTERNETEXPLORER.APPLICATION")
But then I tried to do
Code:
Set IE(Var) = IEWindow.Navigate HLink, 2048
and I get a syntax error. Is there a way to set a tabbed .navigate to a variable so I can refer to it later in the routine?