IE automation question

D

default105

Access 2000
Windows XP SP3
I have a database I am working on and would like to load internet explorer
and use code and DOM structure to auto fill a inputbox on the website I am
going to. I do know the name of the inputbox on the site but am having some
trouble finding information on how to do this task. I am using the code
provided on mvps.org to copy the text to paste in the ie inputbox. How do I
launch Internet Explorer and have the code wait until the page is loaded then
paste the information in the inputbox. I have found some information for vb6
but have had no luck with converting it over to vba. This may be because I
do not have the correct references that I need. From what I have seen online
you need to use the createobject("InternetExplorer.Application") in order to
see if ie is still busy. One snippet of code I found is as follows:
Dim IE
Dim urlStr
urlStr = "www.google.com"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visble = True
IE.Navigate2 urlStr
Do
DoEvents
Loop While IE.Busy = True
MsgBox urlStr & " has now loaded."
IE.Quit
Set IE = Nothing

Am I on the correct path or do I need to start over. Any information is
welcome and greatly appreciated. Thanks
 
D

default105

I found that if I changed IE to IEx it works. I don't know if IE is reserved
by vba or not but this is what I found that worked. Thanks

Dim IEx As Object
Set IEx = CreateObject("InternetExplorer.Application")

IEx.Navigate "www.somesite.com" 'load web page
IEx.Visible = True
While IEx.Busy
DoEvents 'wait until IE is done loading page.
Wend

IEx.Document.all("txtSearch").Value = Me.txtDrawingNumberFull
IEx.Document.all("btnQuickSearch").Click


Set IEx = Nothing
 
R

Raghu

Hi I have came across ur Query. I am also looking the solution for the same.
please send me if you have got any updations or solutions for this. I wanted
to access all the objects present in the browser page.
 

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