Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I automate filling in a Web form with Excel data?

Hi,
I have an Excel spreadsheet with reimbursement/expense data that I need
to submit to my main office. The only way to do this is by filling in
a web form for each reimbursement/expense entry. Can you help me with
VBA or VB code that can extract data from Excel and paste it into an IE
web form?

I just started dabbling with VB 2005, and I am quite proficient with
VBA so any help could go a long way!

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default How can I automate filling in a Web form with Excel data?

Depending on how the page is coded you may well be able to post your data to
the NEXT page that the web form submits to.

e.g. in the page with the web form in it you might have some html like this.

<form action="../PostPage.asp" method="post" name="InputForm"
class="PageTable"
<table border="0"
<tr <td <div class="PageText"Your Name: </div</td
<td <div <span class="PageText"
<input type="text" name="UserName" size="47"
'rest of html omitted here

The important elements in this are the page name: PostPage.asp, and the
variable name: UserName

You should then be able to use the xmlhttp object to send post data.

'first set a project reference to msxml4
Sub TestPost()
Dim objHttp As MSXML2.XMLHTTP40
Set objHttp = New MSXML2.XMLHTTP40
objHttp.Open "POST", "http://www.yourdomain.com/PostPage.asp", False
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHttp.send "UserName=Robin"
'if you have multiple entries it would look like this
'objHttp.send om"
'check the objhttp.status for 200
'you can also look at the responsetext to see what is going on
Set objHttp = Nothing
End Sub

That said, I just tried this and got an access denied on a particular site,
so it might take some testing to get it to work.

HTH,

Robin Hammond
www.enhanceddatasystems.com


"VBwannaB" wrote in message
oups.com...
Hi,
I have an Excel spreadsheet with reimbursement/expense data that I need
to submit to my main office. The only way to do this is by filling in
a web form for each reimbursement/expense entry. Can you help me with
VBA or VB code that can extract data from Excel and paste it into an IE
web form?

I just started dabbling with VB 2005, and I am quite proficient with
VBA so any help could go a long way!

Thanks



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 form filling TimeCreature Excel Discussion (Misc queries) 1 March 18th 11 09:28 AM
Using Excel to automate a preprint form? ZeRo Excel Worksheet Functions 1 November 27th 06 12:45 AM
filling a form in Excel... lookup? maybe? bigwerdz Excel Discussion (Misc queries) 2 September 29th 06 04:18 PM
use VB code IF to automate filling in 11 columns smart.daisy Excel Discussion (Misc queries) 1 May 29th 06 09:08 PM
Filling a Word form from an Excel spreadsheet Roel[_2_] Excel Programming 4 August 2nd 04 08:06 AM


All times are GMT +1. The time now is 06:43 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"