View Full Version : Solved: problem in submitting a web form

09-14-2006, 06:27 AM
Here's my problem.

I'm filling a webform via vba. When I submit it via vba it doesn't work.

If I stop code just before submitting and manually press the submit button or press "ENTER" I reached the right asp page, but if it's done by code I get an error message by the site administrator saying that page is not available at the moment (the fact is that it's a protected area and that's why I can't attach a sample file).

My brute idea is to try a workaround similar to sendkeys or a way to submit the form in a different way from forms.submit.

Has ever happened something similar to you? Any ideas?

Thanks in advance

09-14-2006, 07:31 AM
Are you sure you are submitting the correct form?

09-14-2006, 07:49 AM
Yes, the form is the correct one as other elements belong to the same form and they work fine.

I forgot to mention that the form method is "post" in case it is relevant.

09-14-2006, 09:01 AM

If it is the same form from your other question, it does have some javascript in there which in my experience has sometimes required manually clicking it. However, you might be able to useie.Document.Forms("SYSLog").Item("Esegui").Clickor if you decided to go with that With block, just:.Item("Esegui").Click

upon testing it, this didn't work, as the Esegui item isn't allowing it. I can't find a good way to do this, sorry

09-15-2006, 12:39 AM
Hi Matt, thank you.

The form is not the same you helped me to solve.
So I tried your solution and unfortunately it is not working.

Also this form has routines fired on submit/click as you can see from this HTML extract
<form name="RicAnaProvEnt" method="POST" action="https://extensivenew.bancalombarda.it/tesoreriaenti/breweb/Ls_RicAnaProEntEle.asp" onsubmit="return CheckInput(3);" autocomplete="Off">

I know it's rude but I'm starting to try to simulate a sort of sendkeys and, of course, I don't know how to do it out of excel. There must be an API to do it.

09-15-2006, 08:04 AM
I found a way to solve it.

It is not possible to click the button as item of the form but it works as item of the getElementsByTagName("INPUT").

Actually I don't know why but it works.
thank you Matt for your help. :thumb

09-15-2006, 10:27 AM
Actually I don't know why but it worksGood question! I'll have to give that a try next time I run into the same thing, happens occasionally

09-18-2006, 12:46 AM
OK. Thank you again.