Solved

Close IE Window

Posted on 2006-11-29
2
163 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

777 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