干得好
而不是这个 URL http://fieldwork.genesisenergy.co.nz/
我直接导航到下面的框架 src
<frame name="Login" src="LoginGenesis.aspx?bgColor=FFFFFF&trimColor=FF6600" frameBorder="0" marginWidth="0" marginHeight="0" scrolling="auto">
Sub Website()
Dim IE As Object, Doc As Object, UserName As Object, Password As Object, strCode As String
Set IE = CreateObject("internetexplorer.application")
IE.Visible = True
' IE.navigate "http://fieldwork.genesisenergy.co.nz/"
IE.navigate "http://fieldwork.genesisenergy.co.nz/LoginGenesis.aspx?bgColor=FFFFFF&trimColor=FF6600"
Do While IE.readystate <> 4: DoEvents: Loop
Set Doc = CreateObject("htmlfile")
Set Doc = IE.document
Set UserName = Doc.getelementbyid("userName")
UserName.Value = "santosh"
Set Password = Doc.getelementbyid("userPassword")
Password.Value = "santosh@123"
Set btnLogin = Doc.getelementbyid("loginUser")
btnLogin.Click
End Sub