Solved

Automating Internet Explorer

Posted on 1999-01-13
6
251 Views
Last Modified: 2008-01-09
My application needs to get the URL of the page currently displayed in IE and respond accordingly. Here's part of the code I'm using:
...
    On Error GoTo StartExplorer
    Set ie = GetObject(, "InternetExplorer.Application")
    Exit Function
StartExplorer:
      If Err.Number = 429 Then _
      Set ie = CreateObject("InternetExplorer.Application")
...

According to the documentation, the GetObject function is supposed to start a new instance of IE only if IE is not already running. My problem is that it always opens a new instance of IE.

Am I using GetObject correctly? Or is there any other way to get the current URL (and go to a new URL) in the currently active IE window? I do not want to embed the browser within my app. (I am using DDE with Netscape, and it works fine.)

Thanks. Jim
0
Comment
Question by:biffman9
  • 3
  • 3
6 Comments
 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
Here are the DDE topics:
IExplore|WWW_OpenUrl

0
 

Author Comment

by:biffman9
Comment Utility
I'm willing to give DDE with IE a try, but I'll need more than just the open URL call. I'll also need at least an Activate and a getURL. Pointing me to where IE DDE is documented will do. Thanks.
0
 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
Goto support.microsoft.com and search for Q160957
This article describes DDE in IE.

BTW:
The other topics you requested are WWW_GetWindowInfo and WWW_Activate
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:biffman9
Comment Utility
Good answer. As it turns out, the IE DDE is the same as Netscape, making my code much more elegant. Thanks.

I'm not sure how to re-grade your answer as acceptable and good.


0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 150 total points
Comment Utility
I'll just answer it again.
0
 

Author Comment

by:biffman9
Comment Utility
I've fount that Internet Explorer's response to DDE is a bit unpredictable (not a surprise, I guess, given its problems in other areas). If more than one IE window is open, only the first-opened IE window will respond to DDE; but if you close that first window, the other IE windows will respond as they should.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now