473,545 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controling Internet Explorer?

I'm a still new to visual basic, and I've hit a problem
I can't find a workaround for.

I'm attempting to open and close an Internet Explorer window
using visual basic 6. I've got the open working properly,
but for some reason, I can't close the browser when I'm finished with
it.

Here's the code I'm using for opening and closing
=============== =============== =============== ========

'setup for web popups
Dim oIE
Set oIE = CreateObject("I nternetExplorer .Application")

' Open a URL upon command %
If Left$(CurrentCo mmandString, 1) = "%" Then
oIE.Visible = True
oIE.navigate Mid$(CurrentCom mandString, 2, T - 2)

' Close the Internet Explorer window upon command
ElseIf Left$(CurrentCo mmandString, 2) = "@%" Then
oIE.Quit
oIE.Visible = False

Endif
=============== =============== =============== =========

I've tried oIE.Quit, oIE.Visible=Fal se nothing works,
unless I place the commands right after the open routine.

Can anyone assist?

Jeff

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #1
3 24181
IE.Quit works in script. Maybe you're calling it
before the instance is fully instantiated?

Two thoughts:

1) Don't create an IE instance until you know
that you'll need it. That's a lot of work going on
behind the scenes only to dump it if your string
isn't valid.

2) Use a WebBrowser control on a form instead
of creating IE. A WB is actually an IE window and
uses the IE object methods, but you've got better
control of it. (Get a WB into your toolbox by setting
a reference to "Microsoft Internet Controls".
--
_______________ ______________

ma**********@mi ndYYspring.com
For return email remove XX and YY.
_______________ ______________
Oldbitcollector <ol************ *@mytrashmail.c om> wrote in message
news:MP******** *************** *@news.zoominte rnet.net...
I'm a still new to visual basic, and I've hit a problem
I can't find a workaround for.

I'm attempting to open and close an Internet Explorer window
using visual basic 6. I've got the open working properly,
but for some reason, I can't close the browser when I'm finished with
it.

Here's the code I'm using for opening and closing
=============== =============== =============== ========

'setup for web popups
Dim oIE
Set oIE = CreateObject("I nternetExplorer .Application")

' Open a URL upon command %
If Left$(CurrentCo mmandString, 1) = "%" Then
oIE.Visible = True
oIE.navigate Mid$(CurrentCom mandString, 2, T - 2)

' Close the Internet Explorer window upon command
ElseIf Left$(CurrentCo mmandString, 2) = "@%" Then
oIE.Quit
oIE.Visible = False

Endif
=============== =============== =============== =========

I've tried oIE.Quit, oIE.Visible=Fal se nothing works,
unless I place the commands right after the open routine.

Can anyone assist?

Jeff

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption

=----
Jul 17 '05 #2
IE.Quit works in script. Maybe you're calling it
before the instance is fully instantiated?

Two thoughts:

1) Don't create an IE instance until you know
that you'll need it. That's a lot of work going on
behind the scenes only to dump it if your string
isn't valid.

2) Use a WebBrowser control on a form instead
of creating IE. A WB is actually an IE window and
uses the IE object methods, but you've got better
control of it. (Get a WB into your toolbox by setting
a reference to "Microsoft Internet Controls".
--
_______________ ______________

ma**********@mi ndYYspring.com
For return email remove XX and YY.
_______________ ______________
Oldbitcollector <ol************ *@mytrashmail.c om> wrote in message
news:MP******** *************** *@news.zoominte rnet.net...
I'm a still new to visual basic, and I've hit a problem
I can't find a workaround for.

I'm attempting to open and close an Internet Explorer window
using visual basic 6. I've got the open working properly,
but for some reason, I can't close the browser when I'm finished with
it.

Here's the code I'm using for opening and closing
=============== =============== =============== ========

'setup for web popups
Dim oIE
Set oIE = CreateObject("I nternetExplorer .Application")

' Open a URL upon command %
If Left$(CurrentCo mmandString, 1) = "%" Then
oIE.Visible = True
oIE.navigate Mid$(CurrentCom mandString, 2, T - 2)

' Close the Internet Explorer window upon command
ElseIf Left$(CurrentCo mmandString, 2) = "@%" Then
oIE.Quit
oIE.Visible = False

Endif
=============== =============== =============== =========

I've tried oIE.Quit, oIE.Visible=Fal se nothing works,
unless I place the commands right after the open routine.

Can anyone assist?

Jeff

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption

=----
Jul 17 '05 #3
Hello,

try to use

Dim WithEvents oIE As InternetExplore r

instead of the simple Dim

Greetings

Achim Reichel, Gernany
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2665
by: Raymond H. | last post by:
Hello, I create a vb4 project which can also naviger on Internet via the WebBrowser control which I put on my form. My question is: if this program is installed on a station having already Internet Explorer in it then will it cause an error if version Internet Explorer is the same one as WebBrowser which is in my project? Is it this control...
12
19565
by: SunshineGirl | last post by:
I'm trying to receive events from a running instance of Internet Explorer. So far I've only been able to receive events from an instance I launch from code, but I need to receive events from all running instances of Internet Explorer (I mean those that the user launches himself). I know this is possible because I did it three months ago....
0
1240
by: asadhussain | last post by:
I wrote a plugin to internet explorer that requires internet explorer to be shutdown and restarted. I figured out a way to shut down IE using the MSI and to start it back up using VBScript. I was wondering if there was a way to remember what webpage each internet explorer process was on and then open up internet explorer windows that open...
2
2282
by: CathieC | last post by:
I have a websote developed using visual studio 2005 beta , .net version 2 i deploy my application to a server and it is run from client computers. One of the users gets the error "Internet Explorer cannot open the internet site "XXXXX" Operation aborted" this happens when they click on a menu item to open a page. they do not get
3
2329
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review interpretation): "Half stolen from Firefox, half is buggy - including the stolen part". Download:...
11
11594
by: Wendy | last post by:
Hello, I have a program that does the following: When a user clicks on a row in a VB.NET datagrid, it will open a web page in Internet Explorer (that corresponds to that item in the selected row in the datagrid). It will automatically print that web page, and then it will close the Internet Explorer window. I have code that works...
3
11484
by: laredotornado | last post by:
Hi, This problem only affects PC IE. On a secured page (a page visited via https), there is a link that reads -- "Download HTML File". The link connects to this page <?php require("../../util_fns.php"); session_start();
9
7714
by: Etayki | last post by:
Hi! I am new to VB.net and I am using the Visual Basic 2005 Express Edition I have two questions: 1. I am trying to write an application that will automate Internet Explorer and store data in a database. Am I better off learning VB.net or C#.net? Is there a free development environment for C# as well?
1
2441
by: -Lost | last post by:
This is more of a post to inform, unless of course I am missing something fundamental, in which case I would appreciate anyone explaining it. Based on Mr. Michaux's camelizeStyle function I wrote: function create_style(style) { var p = document.createElement('p'); var t = document.createTextNode('Just something to fill the P.');
0
7496
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7428
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7452
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7784
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5354
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3485
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.