Internet Explorer Object, Navigation, Hiding

  • Thread starter jamcompany via AccessMonster.com
  • Start date
J

jamcompany via AccessMonster.com

Hi,

I use the IE object to navigate to a website and pull some information. I've
run into an issue faced at a client that I have not experienced when testing
it out (the worst kind of error, in my opinion).

Here's the code:
Dim objIE as Object ' late binding
Set objIE = CreateObject("InternetExplorer.Application")

With objIE
.Visible = False
.Silent = True
.Navigate myurl
Do While .ReadyState <> 4
'etc. - code to bomb out if the site can't be found
Loop
mytext = .Document.Body.InnerText

etc.

When I tested the code, Internet Explorer never opened up, so I thought that
the Visible property was set to hide the page (i'm using IE 8, XP). The
client runs the code and IE opens up with the page that I've set to navigate
to (client is on IE8, Vista). After a little reading on other sites and MSDN,
it would seem that after .navigate method is called that the site is visible,
so I should probably set the .Visible property AFTER navigating to the site.
This brings up two questions that I need help to figure out....

1. Why did the client's IE open, not mine? I dug around the IE settings on my
PC, and could not determine an option that would be set to cause this.
2. Will setting the objIE property to .Visible = False AFTER .Navigate just
hide the page, but still allow the user to click over to IE and view it?

What I really need is for the program to navigate to the site, grab the text
information from the file on the site, all in "stealth" mode - that is, the
user is unaware of the process.

Thanks for any help!
 
S

Stefan Hoffmann

J

jamcompany via AccessMonster.com

HI Stefan,

The site is mine, a site I use as an update check site (to see if the app
needs to be updated), and the files to views are .htm (with just tags/text)
and a .xml (again with just tags/text). No scripts or popups.

I did so edits to the code, particularly adding a .Visible = False to the
code after the .Navigate myurl, then downloaded to the client site, and had
the client test this. They are still having issues - IE still pops up,
functionality still affected.

So - if my needs are to navigate to a web site, capture errors if navigation
fails, capture some text on the .htm or .xml file, would XMLHTTP be better,
and why?

I'd still like to know what about their setup automatically throws the page
up into a visible browser (in essence, overruling the code function) when I
specifically apply the .Visible = False property both before and after the .
navigate method is called. These kinds of things can drive one crazy.
 
S

Stefan Hoffmann

hi,

The site is mine, a site I use as an update check site (to see if the app
needs to be updated), and the files to views are .htm (with just tags/text)
and a .xml (again with just tags/text). No scripts or popups.
Especially in this case it is overkill to use the IE control.

btw, another reason why it may popup: Is your domain untrusted? Give it
a try and place it in the trusted internet sites.


mfG
--> stefan <--
 
J

jamcompany via AccessMonster.com

Thanks Stefan - it would see that group policy is overruling my code, and
that's why it's not working. Though I will talk with the user and see if
they can set my site as a trusted site locally.

I took a peek at the vbaexpress article, and I'll test out the code to see
that it will work. Thanks for the direction.

So I'm guessing that using XMLHTTP will not be affected by things like user
security zones, trusted sites, either set up by the user or set by group
policy? Is that correct?
 
S

Stefan Hoffmann

hi,

So I'm guessing that using XMLHTTP will not be affected by things like user
security zones, trusted sites, either set up by the user or set by group
policy? Is that correct?
Gotcha. Me. I'm not sure...

mfG
--> stefan <--
 
J

jamcompany via AccessMonster.com

A little update to this...

you were right on - the reason why IE opened, regardless of the code in
places, was that my domain was not trusted, and once trusted, it worked fine.


The strange thing is that the user does not seem to have noticeable
differences in security settings. The security setting was set to Medium-
High for the internet, yet that was also the level on the IE of my local
test PC (although though Chrome, not IE, is my default web browser). And I
don't have my location as a trusted site, yet the code running on my PC did
not open a web browser. If so, then is there some other setting, perhaps a
standard group setting that can be overridden on the local PC, that causes
such functionality.

?

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top