Link to home
Start Free TrialLog in
Avatar of NORTHBROOK
NORTHBROOK

asked on

Help with closing window

I have designed a program in Visual Basic 6, when a form opens it has a series of buttons, one of the buttons opens Internet Explorer and displays a Web Page. The problem is that i have a hyperlink to close the window in the web page, a message comes up generated by Internet Explorer saying "The web page you are viewing is trying to close the windows" This then lets you click yes or no to close the window, any ideas how to get rid of this?

Thanks people
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

That is the IE behaviour, unless you using window.open to open the web page.
how do you open the IE window in first place?
Avatar of NORTHBROOK
NORTHBROOK

ASKER

This is what im using: -

Private Sub showacp_Click()
     Dim FileName As String, Dummy As String
     Dim BrowserExec As String * 255
     Dim RetVal As Long
     Dim FileNumber As Integer
     BrowserExec = Space(255)
     FileName = "C:\temphtm.HTM"
     FileNumber = FreeFile
     Open FileName For Output As #FileNumber
         Write #FileNumber, "<HTML> <\HTML>"
     Close #FileNumber
     RetVal = FindExecutable(FileName, Dummy, BrowserExec)
     BrowserExec = Trim(BrowserExec)
     If RetVal <= 32 Or IsEmpty(BrowserExec) Then
         MsgBox "Could not find associated Browser", vbExclamation, _
           "Browser Not Found"
     Else
         RetVal = ShellExecute(Me.hwnd, "open", BrowserExec, _
           "-k http://nbcintranet/applications/circulars/file.asp?ID=78", "", SW_SHOWNORMAL)
         If RetVal <= 32 Then
             MsgBox "Web Page not Opened", vbExclamation, "URL Failed"
         End If
     End If
     Kill FileName
     End Sub
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi NORTHBROOK,
This old question (QID 20566372) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept Richie_Simonetti's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer