0
我試圖讓我的宏將我登錄到網站。到目前爲止,我已經輸入了我的用戶名和密碼,但是我不知道如何讓它「點擊」按鈕。該網站是https://www.aum-inc.com/log-in和登錄按鈕不是我知道如何激活的一種。它有某種javascript。下面是我的代碼,HELP用兩行代碼寫成,我需要爲這個特定的案例進行更新。VBA宏與特定網站進行交互
Sub AUM()
'we define the essential variables
Dim ie As Object
Dim pwd, username
Dim button
'add the "Microsoft Internet Controls" reference in your VBA Project indirectly
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate ("https://www.aum-inc.com/log-in")
While ie.ReadyState <> 4
DoEvents
Wend
Set username = .document.getElementById("cphContent_C001_txtUserName") 'id of the username control (HTML Control)
Set pwd = .document.getElementById("cphContent_C001_txtPassword") 'id of the password control (HTML Control)
'HELP Set button = .document.getElementById("ctl00$cphContent$C001$btnPropLogon") 'id of the button control (HTML Control)
username.Value = "Account1234"
pwd.Value = "Password1234"
'HELP button.Click
While ie.ReadyState <> 4
DoEvents
Wend
End With
'insert some sort of code in VBA to find account
Set ie = Nothing
末次
嘗試,ie.document.getElementsbyName( 「btnSubmit按鈕」)(0)。點擊。 –