Consulting

Results 1 to 8 of 8

Thread: Solved: problem in submitting a web form

  1. #1
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location

    Solved: problem in submitting a web form

    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
    ALe
    Help indigent families: www.bancomadreteresa.org

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Are you sure you are submitting the correct form?

  3. #3
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location
    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.
    ALe
    Help indigent families: www.bancomadreteresa.org

  4. #4
    Knowledge Base Approver
    The King of Overkill!
    VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    ALe,

    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 use[vba]ie.Document.Forms("SYSLog").Item("Esegui").Click[/vba]or if you decided to go with that With block, just:[vba].Item("Esegui").Click[/vba]
    Matt

    EDIT:
    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

  5. #5
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location
    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.i...aProEntEle.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.
    ALe
    Help indigent families: www.bancomadreteresa.org

  6. #6
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location
    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.
    ALe
    Help indigent families: www.bancomadreteresa.org

  7. #7
    Knowledge Base Approver
    The King of Overkill! VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    Actually I don't know why but it works
    Good question! I'll have to give that a try next time I run into the same thing, happens occasionally

  8. #8
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location
    OK. Thank you again.
    ALe
    Help indigent families: www.bancomadreteresa.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •