Link to home
Start Free TrialLog in
Avatar of Karen Schaefer
Karen SchaeferFlag for United States of America

asked on

Looking for vba code that will chose IE over Firefox browser

Is there a way to set which browser to be used, no matter which the user has set as default using vba?

Karen
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

try this codes

Dim iz As New InternetExplorer
iz.Navigate "http://www.msn.com"
iz.Visible = True


add to your references the Microsoft Internet Controls library
c:\windows\system32\shdocvw.dll
ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Karen Schaefer

ASKER

I have a internal web based program and is required to use IE and not Firefox.

so I Have a url that opens the webpages, but need to limit the browser.

Thanks for the suggestion Rey I will give it a try.

karen
<I Have a url that opens the webpages>
Then you will have to tell us how to Access the URL string...

In any event, here is another technique.

Dim retval As Variant
retval = Shell("C:\Program Files\Internet Explorer\iexplore.exe " & Me.txtWebsite, vbNormalFocus)

In this case, you must know the location of the IE Executable on the host PC.
The website is taken from a textbox control (or a variable)

Again, just another technique to try, depending on your requirements.

;-)

JeffCoachman
k,
did you try the code i posted at http:#a33932304 
for now this is what I am using - but it relies on the default browser.

        Application.FollowHyperlink ("https://askbert.web.123.com/Brio/personalpages/?url=%2FBrio%2Fpersonalpages%2F&originServlet=BrowserAppName")
        Application.FollowHyperlink ("T:\BERT Data")
        ValidateLinkTable ("ILP_AllEmpTraining_Data")

when I tried Rey's code - I not sure what the path would be to Open IE and MSN.

iz.Navigate "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
iz.Visible = True
     
i based the filepath on the shortcut on my desktop, but when used in the code it ask to be downloaded.  How should I proceed?

K

Rockiroads,

Please elaborate more on this approach.

"you can create a browser control within a form then load pages in there. This browser control is based on IE so this is one sure way to control it."

K


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Rey,

It opens the MSN but then turns around and still wants to open my hyperlink in Firefox (which is my default).

So now I have both MSN open in IE and Firefox open at the same time but the hyperlink for the actual website I need open in Firefox but I can actual use that to processes the data - Since Bert does not work correctly in FIrefox.  Is there a way to overwrite the default value within the hyperlink, like you can in the properties of an Icon?

K
Or is there a way to force it to be the active browser prior to running the hyperlink?

K
Ok Rey,

Once I eliminated the "Application.FollowHyperlink " portion of the code yours worked with my hyperlink.

Thanks,

However, I would like to attempt using Rockiroads method of having the form open within Access.

After trying the embedded method it works better for my needs - thanks to all for the input.

found a good example on how to embed the ActiveX control and uses at

http://www.databasedev.co.uk/access_web_page_viewer.html

Thanks,

K
Thanks for the great assist.

K
Hi Karen. I missed your posts cos I had to pop out. I assume your all sorted now. Good luck with the rest of your project!