Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShellExecute URL string 2

Status
Not open for further replies.

Transcend

Programmer
Sep 29, 2002
858
AU
Hi everyone

I have a form that builds a URL string and then opens it in internet explorer.

However if I leave the window open, then build another URL and execute it, I want it to open in a new instance of IE, but it opens in the same window.

The command i am using is this:

Dim i As Integer

BuildURL'This is a function that builds the URL based 'on parameters i have selected

i = ShellExecute(GetDesktopWindow, "Open", mstrURL, "", "", 1)

How can I get it to open in a new IE window??

Transcend
[gorgeous]
 
Application.FollowHyperlink mstrURL ....?

------------------------
Hit any User to continue
 
If "Reuse windows for launching shortcuts" is checked it is probably the culprit. You can uncheck it (internet options > advanced) or:

Code:
Private Sub Command1_Click()
Dim objIE
With CreateObject("InternetExplorer.application")
    .Visible = True
    .navigate ("[URL unfurl="true"]www.yahoo.com")[/URL]
End With
Set objIE = Nothing
End Sub
 
I originally planned to set objIE the reference but decided not to later. "Dim objIE" and "Set objIE = Nothing" isn't needed in the code above. Thanks for the *
 
The Dim statement is required if you use Option Explicit in your code (reccommended) and the Set = Nothing statement is never 'required' but always wise to clean up your objects.
 
In the above code objIE doesn't need to be Dim'd if using Option Explicit because it's not used.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top