我编写了以下 VBA 代码来自动登录到第三方应用程序。当我运行下面的代码时,它只打开 Internet Explorer 浏览器并导航到链接,然后什么也不做。这是我的代码:
Sub Login_Aravo()
Dim ie
Dim sURL As String
On Error GoTo Err_Clear
sURL = "https://demo.aravo.com/"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate sURL
Do
' Wait till the Browser is loaded
Loop Until ie.readyState = READYSTATE_COMPLETE
ie.Document.all.Item("j_username").Value = "Nothing" 'Enter your username here
ie.Document.all.Item("j_password").Value = "Nothing" 'Enter your password here
ie.Document.all.Item("login").Click
' oBrowser.Refresh ' Refresh If Needed
Err_Clear:
If Err <> 0 Then
'Debug.Assert Err = 0
Err.Clear
Resume Next
End If
End Sub
您的帮助将不胜感激。
感谢奥雅纳