2017-10-20 110 views
0

我想實現自動登錄到我的網站usinf VBscript並通過cmd上的批處理命令運行它。使用VB腳本實現自動登錄

自動登錄得到完成,但還我得到以下錯誤:

VB腳本運行錯誤對象所需IPF 請幫忙爲什麼我收到這個錯誤? 這裏是代碼

Set IE = CreateObject("InternetExplorer.Application") 
IE.navigate "mysitename" 
IE.Visible = True 

While IE.Busy 
WScript.Sleep 50 
Wend 

Set ipf = IE.document.getElementByID("login") 
ipf.Value = "loginid" 
Set ipf = IE.document.getElementByID("password") 
ipf.Value = "password" 
Set ipf = IE.document.getElementByID("button") 
ipf.Click 

回答

0

Dim ipf集之前。

您需要首先聲明對象。

+0

現在我得到了Object Object Error和另外一件事情,如果我第一次處理這個腳本,它不會得到htis錯誤,但是第二次給它。 – renu

+0

嘗試在最後包含'Set ipf = Nothing'。 – Galeaettu