?
Solved

Help with closing window

Posted on 2003-03-28
7
Medium Priority
?
172 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:NORTHBROOK
[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
7 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 8224751
That is the IE behaviour, unless you using window.open to open the web page.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8224829
how do you open the IE window in first place?
0
 

Author Comment

by:NORTHBROOK
ID: 8225063
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
0
Independent Software Vendors: 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!

 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 300 total points
ID: 8225158
Well, if you use Automation, you could access the click event of the link and let your program close the window, not IE itself.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8225202
0
 

Expert Comment

by:CleanupPing
ID: 8531410
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.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9440817
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
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

770 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