Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Web Interface Brain Buster Problem (for me at least :)
Hey all,
Last time I had a brain buster I posted a msg here and I had it solved overnight. Though I would see if I could go for 2. I'm trying to automate the entry of a speedsheet into a webpage form which serves as the front end for a database. heres the trick... The page has several levels of scripting in it which preprocess the fields before they are submited. This means that I cann't simple string my data together and submit it. I have to enter it into the fields seperatly then triger the scripting event which processes it and inturn submits the form. After disecting it I've decided the page does this to conserve on server processing and for data consistancy ( By locking the record and what not) Anyway, is there a way I can reference the componets inside a page to manualy insert the data before trigering the script with a navigate command?? I'm not really sure how the referencing of HTML componets works, but the tag for one of the componets is structured like this... <input type='text' name='CASE_CALLER_NAME' id='CASE_CALLER_NAME' tabindex='40' value="Sibean" class='EDITBOX_DISABLED' style="width:221px; " maxlength='30' disabled='disabled' / an example of a reference call I'm sure would be enough to get me moving again. Are there any magic workers out there who can show me the way??? I'm talking about saving days of work with this script, so you can imagen how happy I'd be :) PS: I know what your thinking, Why not just have the guys down in the corprate skunk works pound in a nice little data loader for you. I thought of that. Guess I'm a little low of the priority to get them to open up that kind of data entry loop hole. basterds. :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Web Interface Brain Buster Problem (for me at least :)
I found the question intriguing so gave it a look. Here's something found and tested at the kbb site. Look down to the bottom of the pag to see the word MYEMAIL typed into the form. Sub HolyCrapThisWorked() 'Dim IE As InternetExplorer '(with reference to internet control selected) 'or Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.navigate "http://www.kbb.com" Do Until IE.readyState = 4 DoEvents Loop IE.Document.emailsignup.email.Value = "MYEMAIL" End Sub Basically, create an IE object and then just deal with it with clien side VB scripting as if it were a web page. In your case, you woul need to know the name of the form (the one at kbb was emailsignup). IE.Document.YourFormNameHere.CASE_CALLER_NAME.Valu e = "MYEMAIL" One advantage would be having some VBScripting knowledge when it come to client side scripting in IE. -- kkkni ----------------------------------------------------------------------- kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754 View this thread: http://www.excelforum.com/showthread.php?threadid=26870 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Web Interface Brain Buster Problem (for me at least :)
Ski,
Been looking at this for a couple of days on the basis that it would be quite useful to figure it out. This works using a couple of asp pages I used to track party responses, bypassing the input page and just submitting straight to the db handler page. 1. Work out what page the form data is being posted to by looking at the action associated with the submit button. 2. Send the data direct to this page as form data from Excel. This can be done using xml and form encoding. Here's how. Sub TestPostFormData() 'requires a project reference to Microsoft XML 4 Dim strAddress As String Dim oXML As MSXML2.XMLHTTP40 Dim strPost As String Dim vData Dim vItems Dim nCounter strAddress = "http://www.yourdomain.com/PageName.asp" vData = Array("Input1", "Input2") vItems = Array(1, 1) For nCounter = 0 To UBound(vData) strPost = strPost & vData(nCounter) & "=" & vItems(nCounter) Next nCounter Set oXML = New MSXML2.XMLHTTP40 With oXML .Open "POST", strAddress, False .setRequestHeader "Content-Type", "application/x-www-form-urlencoded" .send strPost If .Status < 200 Then Debug.Print .Status, .responseText End With End Sub Let us know if it worked. Robin Hammond www.enhanceddatasystems.com "ski" wrote in message om... Hey all, Last time I had a brain buster I posted a msg here and I had it solved overnight. Though I would see if I could go for 2. I'm trying to automate the entry of a speedsheet into a webpage form which serves as the front end for a database. heres the trick... The page has several levels of scripting in it which preprocess the fields before they are submited. This means that I cann't simple string my data together and submit it. I have to enter it into the fields seperatly then triger the scripting event which processes it and inturn submits the form. After disecting it I've decided the page does this to conserve on server processing and for data consistancy ( By locking the record and what not) Anyway, is there a way I can reference the componets inside a page to manualy insert the data before trigering the script with a navigate command?? I'm not really sure how the referencing of HTML componets works, but the tag for one of the componets is structured like this... <input type='text' name='CASE_CALLER_NAME' id='CASE_CALLER_NAME' tabindex='40' value="Sibean" class='EDITBOX_DISABLED' style="width:221px; " maxlength='30' disabled='disabled' / an example of a reference call I'm sure would be enough to get me moving again. Are there any magic workers out there who can show me the way??? I'm talking about saving days of work with this script, so you can imagen how happy I'd be :) PS: I know what your thinking, Why not just have the guys down in the corprate skunk works pound in a nice little data loader for you. I thought of that. Guess I'm a little low of the priority to get them to open up that kind of data entry loop hole. basterds. :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Web Interface Brain Buster Problem (for me at least :)
This is *VERY CLOSE* to what I need to do, except...
* I need to do it with a Windows app in .NET, not VB6. * I need to fill in some form elements on an EXISTING IE page, not create a new one within code. * I need to then have the IE page given focus. I've searched far and wide and this is the closest I've seen. Ideas on how to accomplish in a .NET Windows app and an existing, open IE window? "kkknie" wrote: I found the question intriguing so gave it a look. Here's something I found and tested at the kbb site. Look down to the bottom of the page to see the word MYEMAIL typed into the form. Sub HolyCrapThisWorked() 'Dim IE As InternetExplorer '(with reference to internet controls selected) 'or Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.navigate "http://www.kbb.com" Do Until IE.readyState = 4 DoEvents Loop IE.Document.emailsignup.email.Value = "MYEMAIL" End Sub Basically, create an IE object and then just deal with it with client side VB scripting as if it were a web page. In your case, you would need to know the name of the form (the one at kbb was emailsignup). IE.Document.YourFormNameHere.CASE_CALLER_NAME.Valu e = "MYEMAIL" One advantage would be having some VBScripting knowledge when it comes to client side scripting in IE. K -- kkknie ------------------------------------------------------------------------ kkknie's Profile: http://www.excelforum.com/member.php...fo&userid=7543 View this thread: http://www.excelforum.com/showthread...hreadid=268707 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
BRAIN BUSTER!! MULTI COLUMN ROW DIFFERNCES | Excel Discussion (Misc queries) | |||
BRAIN BUSTER!! MULTI COLUMN ROW DIFFERNCES | Excel Discussion (Misc queries) | |||
Jargon Buster | Excel Discussion (Misc queries) | |||
Formula Problem - Get your brain around this.. | Excel Discussion (Misc queries) | |||
Use Your Brain | Excel Programming |