+ Reply to Thread
Results 1 to 11 of 11

Contol HTML button through VBA

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Contol HTML button through VBA

    Hi.
    My VBA code isn't "clicking" the button, can you see why?

    Please Login or Register  to view this content.
    a,b,c set as Objects. Also, the string "submit" appears in the whole HTML code only once.

    Please Login or Register  to view this content.
    Please * if you like the answer

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Contol HTML button through VBA

    Is it finding the button?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Contol HTML button through VBA

    Hi Norie, I think it does, because "MsgBox b.tabindex" retruns "104" and therefore I know I'm in the right input section.
    Last edited by GIS2013; 07-24-2014 at 04:49 AM. Reason: Typo

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Contol HTML button through VBA

    There is no MsgBox b.tabindex.

  5. #5
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Contol HTML button through VBA

    I revised my code (below), and now no msgbox is showing. So back to your first question, seems like it's not finding the button. How to find it?

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Contol HTML button through VBA

    How about an alternative?

    What you might work is submitting the form the button is on.

    I don't know if there is more than one form on the page but this code is for submitting the first one.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Contol HTML button through VBA

    Splendid works like a charm

    A word why my code is not working (curious)?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Contol HTML button through VBA

    Hard to tell without seeing the page and the rest of the code.

  9. #9
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Contol HTML button through VBA

    I see. Thanks a lot anyway.

    FollowUp question: can I loop through "form" (or "script") just like I did for "input"?

    In my case the loginform was the first, this is why when you wrote doc.forms(0) it worked.

    Please Login or Register  to view this content.
    Last edited by GIS2013; 07-24-2014 at 05:19 AM.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Contol HTML button through VBA

    You could loop through the page's forms collection, not sure about scripts though.

  11. #11
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Contol HTML button through VBA

    I'll check it out later, and update here.

    Cheers.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to link form contol dropdown box to formula cell
    By warriorpoet7176 in forum Excel General
    Replies: 1
    Last Post: 03-09-2014, 09:02 AM
  2. Command Button & HTML help!
    By nedezero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2008, 05:24 PM
  3. [SOLVED] Get embeded HTML Button text
    By Wes Stevens in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2006, 02:20 PM
  4. [SOLVED] excel to html looses button and macro, why?
    By Kelly Mayo in forum Excel General
    Replies: 0
    Last Post: 10-07-2005, 03:05 PM
  5. Can I contol Tab Order in a worksheet?
    By cindee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2005, 10:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1