|
输入一下VBA代码后运行,出现编译错误,并提醒“用户定义类型未定义”这是什么原因,请高手指点
Sub ceshi()
Dim ie As InternetExplorer
Dim doc As HTMLDocument
Dim elementCol As IHTMLElementCollection
Dim element As IHTMLElement
Set ie = CreateObject("internetexplore.applicition")
ie.navigate "http://www.dailydoseofexcel.com/wp-login.php"
ie.Visible = True
Do Until ie.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set doc = ie.document
Set elementCol = doc.getElementsByName("log")
elementCol.Item(0).Value = "youname"
Set element = doc.getElementById("user_pass")
element.Value = "youpassword"
doc.all("rememberme").Checked = 1
doc.getElementById("wp-submit").Click
Set element = Nothing
Set elementCol = Nothing
Set elementCol = Nothing
Set doc = Nothing
Set ie = Nothing
End Sub
|
|