-
1
- #1
All,
I am trying to open an IE window on a button click in an Access form and then and close IE on a button click on the same Access form. I have the code to open the window and to close the window, but this code only works for the original Explorer window that was opened. If the user clicked links in the original window that opened secondary IE windows, those secondary windows are not being closed. How could I make sure that on a button click all open IE windows were closed? The code I have so far is included below.
Thanks,
hilbertl
Public IeApp As InternetExplorer
Sub OpenWindow()
Dim URL As String
Dim IeDoc As Object
Dim i As Long
Set IeApp = New InternetExplorer
IeApp.Visible = True
URL = " IeApp.Navigate URL
Do
Loop Until IeApp.ReadyState = READYSTATE_COMPLETE
Set IeDoc = IeApp.Document
End Sub
Sub closewindow
IeApp.Quit
Set IeApp = Nothing
End Sub
I am trying to open an IE window on a button click in an Access form and then and close IE on a button click on the same Access form. I have the code to open the window and to close the window, but this code only works for the original Explorer window that was opened. If the user clicked links in the original window that opened secondary IE windows, those secondary windows are not being closed. How could I make sure that on a button click all open IE windows were closed? The code I have so far is included below.
Thanks,
hilbertl
Public IeApp As InternetExplorer
Sub OpenWindow()
Dim URL As String
Dim IeDoc As Object
Dim i As Long
Set IeApp = New InternetExplorer
IeApp.Visible = True
URL = " IeApp.Navigate URL
Do
Loop Until IeApp.ReadyState = READYSTATE_COMPLETE
Set IeDoc = IeApp.Document
End Sub
Sub closewindow
IeApp.Quit
Set IeApp = Nothing
End Sub