Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Automate Data Entry from .xls to IE

I was hoping someone could explain in simple terms how i can make it
work, i.e., how do i write this code.

This is what I'd need:
I need to automate entering data into an IE based form. I got that far
to create IE object and to navigate to the url but i:
1. don't know how to get IE element name;
2. post value to that element;
3. make the code click on the element.

This is the unfinished code.

Sub WebLink()

Dim ie As Object
Dim sURL As String
Set ie = CreateObject("InternetExplorer.Application")

sURL = "http://www.yahoo.com"

ie.Visible = True
ie.Navigate sURL

'wait for response
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop

'Here i need a code to:
' 1. enter a value "Australia" in the search box
' 2. Click on "Web Search".

Set ie = Nothing

End Sub

Any help would be extremely helpful as i know something about the VBA
but this is outside my comfort zone. I have, however, achieved the
same result with SendKey - but i wanted to solve it in a bit more
robust way.

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Automate Data Entry from .xls to IE

How about

sURL = "http://search.yahoo.com/search?p=Australia&fr=yfp-
t-501&toggle=1&cop=mss&ei=UTF-8"


HTH,
JP

On Jan 21, 10:54*am, AB wrote:
I was hoping someone could explain in simple terms how i can make it
work, i.e., how do i write this code.

This is what I'd need:
I need to automate entering data into an IE based form. I got that far
to create IE object and to navigate to the url but i:
1. don't know how to get IE element name;
2. post value to that element;
3. make the code click on the element.

This is the unfinished code.

Sub WebLink()

Dim ie As Object
Dim sURL As String
* * Set ie = CreateObject("InternetExplorer.Application")

* * * * sURL = "http://www.yahoo.com"

* * * * ie.Visible = True
* * * * ie.Navigate sURL

* * * * 'wait for response
* * * * Do Until Not ie.Busy And ie.ReadyState = 4
* * * * * * * DoEvents
* * * * Loop

'Here i need a code to:
' 1. enter a value "Australia" in the search box
' 2. Click on "Web Search".

* * Set ie = Nothing

End Sub

Any help would be extremely helpful as i know something about the VBA
but this is outside my comfort zone. I have, however, achieved the
same result with SendKey - but i wanted to solve it in a bit more
robust way.

Thanks in advance!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Automate Data Entry from .xls to IE

Sorry, that didn't wrap properly.

Just go to Yahoo, put "Australia" in the search box and click
"Search", then copy the resulting URL and use it as the variable.
Yahoo puts the search term in the URL so it's simple to automate going
to their website.

For example:

Dim AskMe as String
AskMe = Inputbox("What would you like to search for?")

sURL = "http://search.yahoo.com/search?p=" & AskMe & _
"&fr=yfp-t-501&toggle=1&cop=mss&ei=UTF-8"

If you wanted the same thing from Google it would be:

sURL = "http://www.google.com/search?hl=en&q=Australia"

HTH,
JP

On Jan 21, 11:31*am, JP wrote:
How about

sURL = "http://search.yahoo.com/search?p=Australia&fr=yfp-
t-501&toggle=1&cop=mss&ei=UTF-8"

HTH,
JP

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Automate Data Entry from .xls to IE

Form elements typically are within a named form and themseleves have a
"name" attribute: they may also have an "id" attribute.

To access a "name"d input you can use:
ie.document.formname.elementname.value="myvalue"

If it has an id then:
ie.document.getElementById("theId").value="myvalue "

To submit a form:

ie.document.formname.submit
or
ie.document.forms(0).submit

If you want to investigate what the names or id's for various elements on a
page are then try this:
http://slayeroffice.com/tools/modi/v2.0/modi_help.html

Tim



"AB" wrote in message
...
I was hoping someone could explain in simple terms how i can make it
work, i.e., how do i write this code.

This is what I'd need:
I need to automate entering data into an IE based form. I got that far
to create IE object and to navigate to the url but i:
1. don't know how to get IE element name;
2. post value to that element;
3. make the code click on the element.

This is the unfinished code.

Sub WebLink()

Dim ie As Object
Dim sURL As String
Set ie = CreateObject("InternetExplorer.Application")

sURL = "http://www.yahoo.com"

ie.Visible = True
ie.Navigate sURL

'wait for response
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop

'Here i need a code to:
' 1. enter a value "Australia" in the search box
' 2. Click on "Web Search".

Set ie = Nothing

End Sub

Any help would be extremely helpful as i know something about the VBA
but this is outside my comfort zone. I have, however, achieved the
same result with SendKey - but i wanted to solve it in a bit more
robust way.

Thanks in advance!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Automate Data Entry from .xls to IE

Thanks JP and Tim!

That was exactly what i needed - hints for the directions for me to go
to/to search. The links/advises look really promissing!
That should let me either do the trick or at least get started!

Thanks again!
Reply
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
Automate date & time entry Cheeris Excel Worksheet Functions 1 August 18th 09 10:47 PM
automate data entry on Excel? Pepe Excel Discussion (Misc queries) 1 April 30th 08 12:00 AM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
automate date entry - update pls. medavino Excel Worksheet Functions 5 December 27th 07 09:16 PM
automate date entry medavino Excel Worksheet Functions 9 December 26th 07 04:52 PM


All times are GMT +1. The time now is 01:41 PM.

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

About Us

"It's about Microsoft Excel"