ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening Internet Explorer Only from VBA (https://www.excelbanter.com/excel-programming/431682-opening-internet-explorer-only-vba.html)

treesinger101

Opening Internet Explorer Only from VBA
 
I have written some code to access the Internet, but I need to it to ignore
the default browser and open Internet Explorer only.

I am currently using:
ActiveWorkbook.FollowHyperlink Address:="https://www.blahblahblah.com/"

I have looked everywhere. I hope it is possible. For casual browsing I
prefer another browser; but for certain work related tasks, only IE works
properly.

Thank you for any help.
--
Athena
Payroll Goddess

ron

Opening Internet Explorer Only from VBA
 
On Jul 28, 11:07*am, treesinger101
wrote:
I have written some code to access the Internet, but I need to it to ignore
the default browser and open Internet Explorer only.

I am currently using:
ActiveWorkbook.FollowHyperlink Address:="https://www.blahblahblah.com/"

I have looked everywhere. *I hope it is possible. *For casual browsing I
prefer another browser; but for certain work related tasks, only IE works
properly.

Thank you for any help.
--
Athena
Payroll Goddess


Athena...Try the following...Ron

' set the url
my_url = "https://www.blahblahblah.com/"

' open IE
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate my_url
.Top = 50
.Left = 530
.Height = 400
.Width = 400

' Loop until the page is fully loaded
Do Until .ReadyState = READYSTATE_COMPLETE And Not .Busy
DoEvents
Loop

End With

' Do whatever

' Close IE
ie.Quit

treesinger101

Opening Internet Explorer Only from VBA
 
It worked great except that I had no idea how to exit IE so that I wouldn't
get a debug message; so I just deleted from the "Do Until" loop to the "End
With" and that did the trick.
It also took me a few tries to get the window to open where I wanted, but I
really appreciate that piece of the code. I wouldn't have thought to
customize the window that way.

Thank you!!
--
Athena
Payroll Goddess



All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com