Force IE, not Netscape, to open hyperlink

GMBJames

New Member
Joined
Aug 21, 2002
Messages
22
Hello all,
I'm using excel 2000 and I've added a hyperlink in one cell to launch a specific webpage. I would like to force IE to open the link no matter what the default web browser may be. (I would change the settings on my own personal computer but, several other people will be using this file and I simply cannot go to everyone's desk and set IE as the default browser).
Or alternatively, is there a way using VBA to set IE as the default browser?
Thanks for any help.
Jamie
This message was edited by GMBJames on 2002-10-11 08:35
 
How about one of the following:

<font face=Courier New><SPAN style="color:darkblue">Public</SPAN> <SPAN style="color:darkblue">Declare</SPAN> <SPAN style="color:darkblue">Function</SPAN> ShowWindow& <SPAN style="color:darkblue">Lib</SPAN> "user32" _
    (<SPAN style="color:darkblue">ByVal</SPAN> hwnd <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">Long</SPAN>, <SPAN style="color:darkblue">ByVal</SPAN> nCmdShow <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">Integer</SPAN>)

<SPAN style="color:darkblue">Private</SPAN> <SPAN style="color:darkblue">Sub</SPAN> LoginMrExcel()
<SPAN style="color:darkblue">Dim</SPAN> ie <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">Object</SPAN>
<SPAN style="color:darkblue">On</SPAN> <SPAN style="color:darkblue">Error</SPAN> <SPAN style="color:darkblue">GoTo</SPAN> 1
<SPAN style="color:darkblue">Set</SPAN> ie = CreateObject("InternetExplorer.Application")
<SPAN style="color:darkblue">With</SPAN> ie
    .navigate "http://www.mrexcel.com/board2/login.php"
    <SPAN style="color:darkblue">Do</SPAN> <SPAN style="color:darkblue">While</SPAN> .busy: DoEvents: <SPAN style="color:darkblue">Loop</SPAN>
    <SPAN style="color:darkblue">Do</SPAN> <SPAN style="color:darkblue">While</SPAN> .ReadyState <> 4: DoEvents: <SPAN style="color:darkblue">Loop</SPAN>
    <SPAN style="color:darkblue">With</SPAN> .Document.Forms(0)
        .UserName.Value = "Mr. Excel Login Name"
        .password.Value = "Respective Password"
        .login.Click
    <SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">With</SPAN>
    <SPAN style="color:darkblue">Do</SPAN> <SPAN style="color:darkblue">While</SPAN> <SPAN style="color:darkblue">Not</SPAN> <SPAN style="color:darkblue">CBool</SPAN>(InStrB(1, .Document.url, "index.php"))
       DoEvents: <SPAN style="color:darkblue">Loop</SPAN>
    <SPAN style="color:darkblue">Call</SPAN> ShowWindow(.hwnd, 3) <SPAN style="color:green">'Maximize</SPAN>
    .Visible = <SPAN style="color:darkblue">True</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">With</SPAN>
<SPAN style="color:darkblue">Set</SPAN> ie = <SPAN style="color:darkblue">Nothing</SPAN>
<SPAN style="color:darkblue">Exit</SPAN> <SPAN style="color:darkblue">Sub</SPAN>
1:  MsgBox "Unexpected <SPAN style="color:darkblue">Error</SPAN>, sorry."
    ie.Quit
    <SPAN style="color:darkblue">Set</SPAN> ie = <SPAN style="color:darkblue">Nothing</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN>

<SPAN style="color:darkblue">Sub</SPAN> test()
<SPAN style="color:darkblue">Dim</SPAN> WScript <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">Object</SPAN>
<SPAN style="color:darkblue">Set</SPAN> WScript = CreateObject("WScript.Shell")
WScript.Run "IExplore.exe http://www.mrexcel.com"
<SPAN style="color:darkblue">Set</SPAN> WScript = <SPAN style="color:darkblue">Nothing</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN></FONT>
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How can I use sendkeys with NateO's code?

For example after logging into mrexel.com website I want to copy the entire webpage by using CTRL+A and paste it in Sheet(0) ie sheet1
 
Upvote 0
Can you tell me what the following is used for?

Public Declare Function ShowWindow& Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Integer)


What does it do?
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,721
Members
449,465
Latest member
TAKLAM

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