Solved

Close IE Window

Posted on 2006-11-29
2
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 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