LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Control Website from Excel

I am trying to control a website from Excel VBA. It has page source
below:


<FORM class=chooser_form id=chooser_form name=chooser_form
onsubmit="return false;" action=http://www.example.com/ method=post
<INPUT type=hidden value=en name=lang
<DIV class=entry_url_out
<INPUT class=entry_url name=URL
</DIV
<DIV class=selector_site_2_out
<SELECT class=selector_site_2
onchange=change_info(document.chooser_form.site.se lectedIndex);
name=site
<OPTION value=Option1Option1</OPTION
<OPTION value=Option2Option2</OPTION
</SELECT
</DIV
<INPUT class=entry_submit onfocus=this.blur(); onclick=buttonDownload()
type=submit
</FORM


That website change a text into another text. Normaly under IE, we must
type on the input box in that website, and click the button.
Afterwards, that web show the result.
By this code below, I have succeed to enter a text in to the input box,
but I can't "click" in the button because that button didnt have a
name. Here is my code

Private Sub OpenWebPageAndInput_Click()
Dim objIE As Object
On Error GoTo error_handler
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate "www.example.htm"
Do While .Busy: DoEvents: Loop
Do While .readyState < 4: DoEvents: Loop
.Visible = True
With .Document.Forms("chooser_form")
.URL.Value = "test"
.submit '< this line was error

End With
End With
Set objIE = Nothing
Exit Sub
error_handler:
MsgBox ("Unexpected Error, I'm quitting.")
objIE.Quit
Set objIE = Nothing
End Sub


I have tried SendKeys "{ENTER}", True but it was fail too

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel spin box - no Control tab in Format Control dialong box tocoau Excel Worksheet Functions 7 August 10th 08 03:15 PM
Website for Excel pgarcia Excel Discussion (Misc queries) 3 September 7th 07 09:51 PM
Linking website to Excel thanhnguyen[_13_] Excel Programming 2 March 8th 06 06:05 AM
Excel doc on a website Stewart[_3_] Excel Programming 0 May 17th 04 10:10 AM
Launching a website from Excel Chris Gorham[_3_] Excel Programming 2 January 14th 04 07:14 PM


All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"