Re: VBA Set new IE tab as variable
The code I've got for the username and password elements works. It will log in and submit my username and password correctly to each site. It will run thru each website I have and correctly login to each. The problem is each new site is overwriting the previous one in the same window, thus my need for tabs. I would like to reference each newly opened tab right after it opens and then perform the login.
Code
With IE
.Visible = True
.Navigate "www.2ndtab.com[/URL]",CLng(navOpenInNewTab)
Do Until.ReadyState = 4
DoEvents
Loop
How do I use this part/object that was just created below?
Code
.Navigate [URL="http://www.2ndtab.com/"]www.2ndtab.com[/URL]",CLngnavOpenInNewTab) = somevariable
Then use:
Code
IE.somevariable.all.Item("userid").Value = cUsername
IE.somevariable.all.Item("password").Value = cPassword
IE.somevariable.forms(0).submit
Can I reference the newly created tab, do the work on the said tab, then move on to next tab, etc.?