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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
7,793
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

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
You need to goto Tools>References... and add the reference(s) that are mentioned at the start of code ZVI posted.s
 
Upvote 0

richardcarter

Board Regular
Joined
Dec 10, 2003
Messages
77
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

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
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

richardcarter

Board Regular
Joined
Dec 10, 2003
Messages
77
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

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
Which browser is your default?
 
Upvote 0

Forum statistics

Threads
1,191,361
Messages
5,986,203
Members
440,010
Latest member
cdotshel

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
Top