Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Automating Internet Explorer

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
biffman9
Asked:
biffman9
  • 3
  • 3
1 Solution
 
MirkwoodCommented:
Here are the DDE topics:
IExplore|WWW_OpenUrl

0
 
biffman9Author Commented:
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
 
MirkwoodCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
biffman9Author Commented:
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
 
MirkwoodCommented:
I'll just answer it again.
0
 
biffman9Author Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now