Beginner help with opening webpages using IE as object

richardcarter

Board Regular
Joined
Dec 10, 2003
Messages
77
Am trying to learn how to open a webpage using Internet Explorer as an object (not hyperlink). I can see many 'beginners guides' on how to open a web page and fill out a form etc.. but none relating to just opening a web page!!!

This is all I am trying to do: When I click on a stock code in a cell (e.g TSCO.L), I would like Excel to display the webpage 'https://uk.finance.yahoo.com/q?s=TSCO.L' in an already open IE instance. If I then click on another cell such as 'SBRY.L' then the webpage should change accordingly. Any pointers would be appreciated, many thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Use the Worksheet_SelectionChange event to handle the cell click. Loop through Shell.Windows to find the open IE instance, then navigate to the URL.
 
Upvote 0
You need to goto Tools>References... and add the reference(s) that are mentioned at the start of code ZVI posted.s
 
Upvote 0
Thanks - I will try to figure out how to add that reference code... but before I spend another 4 hours trying to figure out which part of the code it is, does it mean that if I email the file to a colleague, they will also have to add the reference code on their PC or will it be embedded in the file? Thanks
 
Upvote 0
It should be embedded in the file.

PS You'll easily find the required reference if you goto Tools>References... in the VBA. Once you've found it all you need to do is check it, no need to add further code.
 
Upvote 0
Thanks for your help Norie, I figured that out... But now Im totally confused because I was on the understanding that the IE object model doesnt work with Firefox (my default browser), but when I ran the code it opened the webpage in Firefox...
 
Upvote 0
Which browser is your default?
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

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