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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open IE from Access - Want to Use Current ie Window - Not a New One 1

Status
Not open for further replies.

PurpleUnicorn

Programmer
Mar 16, 2001
79
US
I have a form containing a list of items that I want to search for at a particular site. I construct my url using the selected item.

I have tried:
application.followlink myUrl,, false
shellexecute ...sUrl...
Web Browser control
InternetExplorer object

All allow me to follow the link and open a browser - always a new browser. I want to reuse the open browser. How can this be done? (The "Reuse windows for launching shortcuts option in IE is checked)

Thanks in advance!
 
Thanks for the quick response. I have already tried the following:

Dim wbBrowser As New SHDocVw.InternetExplorer
wbBrowser.Visible = True
wbBrowser.navigate sUrl, Nothing, Nothing, Nothing, Nothing

Every time I click the button to search the internet - a new browser opens. Am I doing something wrong?

Thanks again.
 
Code:
Dim ie As InternetExplorer
Dim sw As New ShellWindows
Set ie = sw(0)
ie.Navigate "[URL unfurl="true"]http://www.tek-tips.com/"[/URL]
 
adalger,

I could not get your code to work - nothing happened when I ran it.
 

Sorry about that - I did get it to work. I didn't realize that IE must be opened first. Thanks. Now I just need to figure out how to test for an open browser.
 
Have a look at the GetObject method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
It's even easier than GetObject:
Code:
    Dim ie As InternetExplorer
    Dim sw As New ShellWindows
    If sw(0) Is Nothing Then
        Set ie = New InternetExplorer
        ie.Visible = True
    Else
        Set ie = sw(0)
    End If
    ie.Navigate "[URL unfurl="true"]http://www.tek-tips.com/"[/URL]
 
Thank you so much adalger and PHV. I have spent so much time on this. My boss does hundreds of searches a day and can not have hundreds of browsers open!

I used the code above - so short and sweet and
I also located some code (here at tek-tips) to maximize the ie object and bring it into focus. Thank you again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top