powershot32
New Member
- Joined
- Aug 26, 2014
- Messages
- 18
I have a macro that will grab information from a excel document, open a webpage, navigate a html form and open a new tab from the HTML field related to the excel document. This is where I get stuck.
I'm trying to paste the copied information from the document onto this page but I can't seem to get it to work.
Here is my code that works on the initial website
So that correctly clicks the search button after it has entered the data into the search field. However once the new tab opens and I have to click another button it doesn't work. I use the same exact code (obviously formatted to find the correct button) but the button never gets clicked and I don't even get an error. The macro just ends doing nothing.
Here is the code after the search.
So I ruled out the wait time, because I've gone up to 10 seconds and it still just ends, so its not that the website is taking too long to load. Does it have something with the new tab being opened and the macro still trying to run on the other webpage and not the new tab? Or is there something else I am missing?
Thanks for any help.
I'm trying to paste the copied information from the document onto this page but I can't seem to get it to work.
Here is my code that works on the initial website
Set SearchButton = IE.Document.getElementsByName("bodyroductSearchForm:searchButton")
For Each Butt******* In SearchButton
If Butt*******.Value = "S(e)arch" Then
Butt*******.Click
Exit For
End If
Next Butt*******
So that correctly clicks the search button after it has entered the data into the search field. However once the new tab opens and I have to click another button it doesn't work. I use the same exact code (obviously formatted to find the correct button) but the button never gets clicked and I don't even get an error. The macro just ends doing nothing.
Here is the code after the search.
application.Wait (Now + TimeValue("00:00:05"))
Set ShowAll = IE.Document.getElementsByName("body:attributesForm:showAll")
For Each AllClick In ShowAll
If AllClick.Value = "Show (A)ll" Then
AllClick.Click
Exit For
End If
Next AllClick
So I ruled out the wait time, because I've gone up to 10 seconds and it still just ends, so its not that the website is taking too long to load. Does it have something with the new tab being opened and the macro still trying to run on the other webpage and not the new tab? Or is there something else I am missing?
Thanks for any help.