+ Reply to Thread
Results 1 to 6 of 6

Click button on website from VBA

  1. #1
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Click button on website from VBA

    Hi all

    I have the following code to click a button on a website.

    Please Login or Register  to view this content.
    The website opens correctly, but I get an error on the line set above. The website is mostly text and has a button to proceed. Here is the web code that references the button:

    Please Login or Register  to view this content.
    A couple questions:
    1) Do I need to have any particular references checked to be able to navigate websites in Excel VBA?
    2) I can't really read web code yet, what should that line be to click the button to proceed?

    Thanks!
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Click button on website from VBA

    Anyone know anything about this?

  3. #3
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Click button on website from VBA

    I could be wrong, but I don't think you can 'click' a website button like that with VBA, which is why you are getting the error.
    It looks like the button just jumps the website to another relative url, which you seem to already know, so you could likely just do this:

    Please Login or Register  to view this content.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Click button on website from VBA

    The only problem is that the website goes into different pages, but the url in the address bar is the same for all pages.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Click button on website from VBA

    What you've pasted in that code to me looks like an image with a hyperlink, not a button, so I doubt you could click it.
    Remember what the dormouse said
    Feed your head

  6. #6
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Click button on website from VBA

    Quote Originally Posted by davegugg View Post
    The only problem is that the website goes into different pages, but the url in the address bar is the same for all pages.
    That may be the case, but that doesn't change the fact that the web code you have posted would appear to be for a clickable image that is then hyperlinked to a relative url.
    I would still recommend testing it by typing the original address in the address bar of your browser, followed by:
    Please Login or Register  to view this content.
    and see what happens.

    It is also possible that the link is being interpreted by a script. If the website is a public one the if you post the url we may be able to help more

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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