Hi,

I have a macro that is supposed to run and loop over some websites each in a tab
opens the first tab, fills out a username and pw and then click a submit button.
Then the macro should open another page in a new tab and then fill out fields username and pw and click the submit
But the problem is that the IE object that I have in the code does not seem to be updated to reference the new page
so it throws an error. Any idea how to make point to the new IE tab??

countTab = 0

for website in websites
IE.Navigate2 website, countTab
countTab = CLng(&H800)

With IE.document.forms(formID)
.elements(userNameFieldID).value = userName <----- this is where it stops the second time
.elements(passWordFieldID).value = password
End With
Set TDelement = IE.document.getElementById(submitButtonID)
TDelement.click
next