Can Excel do this?

I wrote Excel code that opens up IE and navigates to a webpage on an intranet. This web page has input boxes where numbers are entered.

I want Excel to place the values of certain cells in the appropriate text boxes (which were created via javascript). Does anyone know a way to get Excel to pass the variables to a webpage without altering the target webpage scripts?

Is this even possible?

Maybe. What I’m picturing is writing a macro that will take the values from the Excel sheet and translate that into hyperlink data. The macro would build the hyperlink on the fly, so to speak.

I haven’t done anything like this so it may not work. On the other hand it just may…

If you open your browser and fill in the input boxes and hit Enter or click some kind of “OK” button…

does your browser end up going to an URL that looks vaguely like this?

http://www.blahblahblah.com/webpg/pg?boxone=whatyouput&boxtwo=nextlineyouput&next=so_on

If so, use Excel’s calcs to assemble the final URL and bypass the page with the input boxes altogether.

(an example being Lycos Maps. you can have a FileMaker database go directly to a map of an address entered in a database by compiling the proper map URL)

Hmmph! vBulletin, trying to be helpful, shortened the URL as it appears in the post. Hover over it with your mouse and examine the associated URL to see what I typed.

After more research I have found out the following:

An HTML page can send information through two methods, POST and GET.

The GET method is actually sort of easy and resembles what AHunter3 refers to. I used Excel to get to that page. Thanks!

Now, the POST method sends data to the server from the webpage and you have to reference each named control and its value in a POST command from Excel.

Of course, things can’t be that easy! The webpage I’m using has created the input boxes using javascript. Each control is named the same and I think when you hit “Submit” each control passes the entered value to another javascript function.

So that’s where I’m stuck. How can I pass values to a control that is named the same but appears on the webpage a number of times?

Just put the name in once for each value with that name. Like this:

response.asp?input=1&input=2&input=3

I’m not sure that’s going to work. The input boxes are lined up horizontally, one for each month, and they all have the same name, pl0. Here’s a snippet of the javascript:

<td>
<input type=hidden name=“hidpl0” value="" >
<input type=“text” name=“pl0” size=11 maxlength=8 style=“text-align:right;” value=“63284”

onkeypress=CaptureKeypress() onfocus=this.select(); onclick=“this.focus();this.select();” onchange=“setHiddenPLValue(0, 6)” onkeyup=“getLastChangedFldName(this,6);setHiddenPLValueFor0(0, 6, this);getRowTotal(0);getColumnTotal(0, 6)” onblur=“checkValue(this);”
>
</td>

What I need to do is send a new value to replace the 63284.

Hmm…if it was vbscript, I could give you a reference. However, that’s how input from forms with several controls sharing the same name gets passed using a GET method, so there is some way to deal with it in javascript.