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!
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!