PC Review


Reply
Thread Tools Rate Thread

Automated Web Form throught Excel

 
 
=?Utf-8?B?QnJ5YW4=?=
Guest
Posts: n/a
 
      23rd Oct 2007
I visit multiple websites each week posting updated data that I save in
an excel 2003 spreadsheet. I would like to automate this process to
save time but I have struggled as I am not proficent writing code.

I am a novice with a variety of experience. Mostly adapting
similar code. I have been directed to multiple places with no luck so
I am posting again to see if anyone can help.

I need to enter saved data from my speadsheet into
the fields of a web form. Then, submit the form.

I have all of the data for the forms stored in a spreadsheet.
If you could help with an example using,
http://www.mapquest.com/maps/main.adp entering data
and clicking submit.

Thank you in advance for your help!

 
Reply With Quote
 
 
 
 
anon
Guest
Posts: n/a
 
      23rd Oct 2007
I did a similar thing a while back and tried lots of different ways
with varying success.

The simple (but not always successful way - you may get variable
results) is to use send keys

So you would navigate to the web page, your code would then "press"
the tab key until the correct form box was selected (eg. address).
Then your code would copy the value from your excel sheet into the
form box. You could repreat this for a couple of boxes and then your
code would "press" enter to submit the form to the web page.

The alternative is to view the source code of the web page and get the
names of the form boxes (click View and then source on the menus
whilst on the page). I believe you can then set the values of these
boxes with your code, and submit using send keys.


 
Reply With Quote
 
Sean
Guest
Posts: n/a
 
      23rd Oct 2007
Bryan

Whay you need to do is firstly create a Data Link to your required web
site, pulling it back to a sheet, then just refresh the data via your
code each time you require to run it.

Data - Import External Data - New Web Query: Just navigate to your
site and select the relevant data

The code below refreshes a number of these Web queries, just change
sheet name and range to suit, it also does a couple of other things
like hiding sheets which you won't want, again change to suit

Sub GetLatestPrices()


Application.ScreenUpdating = False

Sheets("Web Prices").Activate
ActiveSheet.Visible = True
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

Range("I1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

Range("Q1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

Range("T1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("A1").Select

ActiveSheet.Visible = xlVeryHidden

Sheets("Current Prices").Select

Range("H27:I27").Select
Selection.Copy
Range("F27:G27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Application.CutCopyMode = False

Range("A1").Select

Sheets("Web Prices").Activate
ActiveSheet.Visible = xlVeryHidden

Sheets("Current Prices").Activate
Range("A1").Select

Application.ScreenUpdating = True

End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
an I get a cell value throught posted hyperlink to another excel s Mohamed Microsoft Excel Worksheet Functions 0 9th Dec 2009 01:42 PM
Sending the current form as an attachment throught email Public Microsoft Access Form Coding 1 15th Jun 2008 01:00 PM
The excel calling msquery question throught DDE row wang Microsoft Excel Programming 0 5th Nov 2007 09:25 AM
the excel calling msquery question throught DDE row wang Microsoft Excel Programming 0 5th Nov 2007 09:24 AM
How to cycle throught controls in a form....? Paul Microsoft Access Forms 1 24th Jun 2004 09:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:29 AM.