Opening Internet Explorer Only from VBA

  • Thread starter Thread starter treesinger101
  • Start date Start date
T

treesinger101

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.
 
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...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
 
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!!
 
Back
Top