Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

Controling a web page - fill in text & submit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
clueless John - 30 Aug 2005 15:35 GMT
I posted this previously, but got no response.  Am I even in the right place
for this question?

I am trying to automate a daily download process that manually requires me
to navigate to a website, select a radio button, fill in two text boxes and
click a submit button.  I can get Access to open IExplorer and navigate to
the website by using
   Dim ieApp As InternetExplorer
   Set ieApp = New InternetExplorer
   ieApp.Visible = True
   ieApp.Navigate "http://...

After that, I am lost.  I've tried to use ieApp.PutProperty with no success.
(I'm either not getting the syntax right, or it just isn't the right method,
???)

Does anyone have a clue for me?

Signature

I may not know yet, but I will.

Tim Ferguson - 30 Aug 2005 17:26 GMT
"=?Utf-8?B?Y2x1ZWxlc3MgSm9obg==?="
<cluelessJohn@discussions.microsoft.com> wrote in
news:6EB3D4CD-4A34-4502-ABFB-1164DBA980E1@microsoft.com:

> I am trying to automate a daily download process that manually
> requires me to navigate to a website, select a radio button, fill in
[quoted text clipped - 4 lines]
>     ieApp.Visible = True
>     ieApp.Navigate "http://...

With a bit of digging around in the form's source code, you should be
able to reconstruct the entire URI of the completed form; then use the
GET or POST method to get the result. You should be able to do this with
a

 Set oHttpPost = CreateObject("Microsoft.XMLHTTP")
 oHttpPost.Open "GET", c_urlCheckIP, False

or something like that.

Hope it helps

Tim F
clueless John - 30 Aug 2005 19:33 GMT
I get an invalid procedure call on the line
oHttpPost.Open "GET", c_urlCheckIP, False
Can you explain what it is doing?  I don't get any hints form VBA since this
is a generic Object.

As far as digging in the code,
The only access to the web page code is through right-click View Source.  I
can identify the names of text boxes, radio buttons, and the submit button
caption.
The submit action appears to be this:
<FORM action="ViewReport.asp" method=Post target=_blank id=form1
name=form1><strong>
It opens another explorer window that churns for a while as
http://...ViewReport.asp, then turns into the report as an excel spreadsheet
with a very long and strange address.  
http://...viewrpt.cwr?id=52032&apstoken=...

Can any of this be useful to me?
   

Signature

I may not know yet, but I will.

> "=?Utf-8?B?Y2x1ZWxlc3MgSm9obg==?="
> <cluelessJohn@discussions.microsoft.com> wrote in
[quoted text clipped - 22 lines]
>
> Tim F
Tim Ferguson - 31 Aug 2005 10:39 GMT
"=?Utf-8?B?Y2x1ZWxlc3MgSm9obg==?="
<cluelessJohn@discussions.microsoft.com> wrote in
news:83DBB128-15B0-497D-B4BC-B6BDEF17B2AC@microsoft.com:

> I get an invalid procedure call on the line
> oHttpPost.Open "GET", c_urlCheckIP, False
> Can you explain what it is doing?  I don't get any hints form VBA
> since this is a generic Object.

Have you tried googling for "Microsoft.XMLHTTP" -- lots of good advice
there?

> As far as digging in the code,
> The only access to the web page code is through right-click View
> Source.  I can identify the names of text boxes, radio buttons, and
> the submit button caption.

That is all you need. Forms are submitted using a url that is made of the
page address and a ? and the id and value pairs delimited with & and =
characters. This is from memory, but the details are in any basic HTML
book.

> The submit action appears to be this:
> <FORM action="ViewReport.asp" method=Post target=_blank id=form1
> name=form1><strong>

There you go: the uri will look something like

http://somewhere.com/folder/viewreport.asp?name=tim%20F&age=21&hidden=true

and you need to use the POST method rather than the GET.

> Can any of this be useful to me?

All of it! FWIW, this is just what happens behind the scenes with search
toolbars etc.

Hope it helps: if you need any more in depth pointers, then you are
probably better off in an HTML forms group than a database one!

Tim F
clueless John - 31 Aug 2005 14:54 GMT
Thanks!  Those were the clues I needed.
Signature

I may not know yet, but I will.

> "=?Utf-8?B?Y2x1ZWxlc3MgSm9obg==?="
> <cluelessJohn@discussions.microsoft.com> wrote in
[quoted text clipped - 37 lines]
>
> Tim F
clueless John - 01 Sep 2005 16:29 GMT
I also found another way
Set ieApp = CreateObject("InternetExplorer.Application")
   
   With ieApp
       ' Make the window visible.
       .Visible = True
       
       ' Navigate to the input page.
       .Navigate "http://.......asp"
       
       ' Loop while the page loads.
       Do While .Busy: DoEvents: Loop
           Do While .ReadyState <> 4: DoEvents: Loop
       
       ' Fill in the fields on the form.
       ' Form(0) refers to the first form on the page.
       ' the forms collection is Zero based.
     
       With .Document.Forms(0)
           
           ' Click the Detail radio button (Summary is (0)).
           .rpt(1).Click
           
           ' Set the dates.
           .stdate.Value = sStart
           
           .enddate.Value = sEnd
           
           ' Click Submit to run the report.
           .submit
           
       End With
     
Signature

I may not know yet, but I will.

> I posted this previously, but got no response.  Am I even in the right place
> for this question?
[quoted text clipped - 13 lines]
>
> Does anyone have a clue for me?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.