Solved

Close IE Window

Posted on 2006-11-29
2
161 Views
Last Modified: 2008-03-17
I'm trying to redirect the webpage that i'm on from it's current one back to the homepage once 'ok' has been hit. I'm running into problems while trying to accomplish this task. I just want the window to close once 'cancel' has been hit and a new window to open once the window has closed. I guess in this case a redirection would make most sense, but i'm also trying to learn how to close IE windows.


If rs.EOF Then
            message  = MsgBox "You need to login again!", 49, "Cannot Log User In"
            if message = 1 then
Set IE = CreateObject("InternetExplorer.Application")
            IE.navigate "http://localhost", 1
elseif message = 2
(Trying to close IE Window)
(Then I'm trying to open a new one and direct to http://localhost)
      Else
*blah blah blah


Thanks,
NP
0
Comment
Question by:NP2322
2 Comments
 
LVL 12

Expert Comment

by:jkaios
ID: 18041321
Have you tried the quit method?

  IE.Quit
0
 
LVL 20

Accepted Solution

by:
hes earned 250 total points
ID: 18041350
Set a reference to Microsoft Internet Controls:


Dim ShellWin As New ShellWindows
Dim IE As InternetExplorer


For Each IE In ShellWin
     IE.Quit
Next
Set IE = Nothing
0

Featured Post

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

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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

11 Experts available now in Live!

Get 1:1 Help Now