Edge - Updating URL on existing Browser Tab

markf5998

Board Regular
Joined
Jan 13, 2011
Messages
103
I have some code that loops through a bunch of selected cells and for each one, searches for that term on a website...it works, but each search term results in a new browser tab. Any suggestions on how I can get just 1 tab to cycle through each term?

VBA Code:
For Each Cell In Selection

    Application.Wait (Now + TimeValue("00:00:" & WaitTime))
    SearchTerm = Cell.Value
    CreateObject("Shell.Application").ShellExecute "https://www.myURL.com/s?searchTerm=" & SearchTerm

Next Cell
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi Mark,
you'd have to add quite a bit of code, basically automating Edge/Chrome. Currently, the "CreateObject" line causes the new tabs, so you'd need to first set a "browser object" and after that use that object to browse to your different pages. I assume you also want to process the result? If so, VBA can also do that...

Some examples/resources (found searching for "excel vba automate browser"):
Automate Chrome / Edge using VBA (a bit more advanced)
Docs | VBA-Web (a full library with tools)

Cheers,

Koen
 
Upvote 0
Hi Mark,
you'd have to add quite a bit of code, basically automating Edge/Chrome. Currently, the "CreateObject" line causes the new tabs, so you'd need to first set a "browser object" and after that use that object to browse to your different pages. I assume you also want to process the result? If so, VBA can also do that...

Some examples/resources (found searching for "excel vba automate browser"):
Automate Chrome / Edge using VBA (a bit more advanced)
Docs | VBA-Web (a full library with tools)

Cheers,

Koen
Great info, thank you!
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,077
Members
449,094
Latest member
mystic19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top