473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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("InternetExplorer.Application")

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

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

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

I've tried oIE.Quit, oIE.Visible=False 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 24161
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**********@mindYYspring.com
For return email remove XX and YY.
_____________________________
Oldbitcollector <ol*************@mytrashmail.com> wrote in message
news:MP************************@news.zoominternet. 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("InternetExplorer.Application")

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

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

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

I've tried oIE.Quit, oIE.Visible=False 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**********@mindYYspring.com
For return email remove XX and YY.
_____________________________
Oldbitcollector <ol*************@mytrashmail.com> wrote in message
news:MP************************@news.zoominternet. 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("InternetExplorer.Application")

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

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

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

I've tried oIE.Quit, oIE.Visible=False 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 InternetExplorer

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
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...
12
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...
0
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...
2
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...
3
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...
11
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...
3
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...
9
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...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.