VBA "Clicking" on a Button an website

pingme89

Board Regular
Joined
Jan 23, 2014
Messages
176
Office Version
  1. 365
Platform
  1. Windows
There is a website I am trying to use VBA to input the Username and Password and then "Click" the submit button.

I was successful in placing the Username and Password into the appropriate fields, but I can't get it to "click" on the Login Button.

This is the website: https://sso.godaddy.com/login?realm=pass&app=email

Any help would be much appreciated. Thanks.<strike></strike>
 
The above code was written for vba. Try this for VBS, I don't know much.



VBA Code:
    With CreateObject("InternetExplorer.Application")

        .Visible = True
        .Navigate "https://ctxportalvdi.emblemhealth.com/vpn/index.html"

        While .Busy Or .readyState <> 4
             dteWait = DateAdd("s", 1, Now())
             Do Until (Now() > dteWait)
             Loop
        Wend

        Set chng = .document.createEvent("HTMLEvents")
        chng.initEvent "change", True, False

        .document.GetElementById("Enter user name").Value = "user"
        .document.GetElementById("passwd").Value = "pass"

        Set chk = .document.GetElementsByname("eula_check")(0)
        chk.Checked = True
        chk.dispatchEvent chng
        .document.GetElementById("Log_On").Click

        '     .Quit
    End With
u are genius.. its working.. can I get ur contact number. im having many doubts related to this.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top