Solved

Automating Internet Explorer

Posted on 1999-01-13
6
253 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
ID: 1455946
Here are the DDE topics:
IExplore|WWW_OpenUrl

0
 

Author Comment

by:biffman9
ID: 1455947
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
ID: 1455948
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:biffman9
ID: 1455949
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
ID: 1455950
I'll just answer it again.
0
 

Author Comment

by:biffman9
ID: 1455951
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel VBA combine two working workbooks 8 53
Copy a row 12 61
How to measure sizes and angles in scanned images ? 3 63
MS Access 03, TransferText, decimal places 8 69
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

770 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