Why is my VBScript not logging in properly? This .vbs script should open reddit
ID: 3908941 • Letter: W
Question
Why is my VBScript not logging in properly?
This .vbs script should open reddit and automatically login. Instead I get an error stating I need an object? (The username and password fields are not an actual account).
Set objIE = CreateObject("InternetExplorer.Application")
Call objIE.navigate("https://old.reddit.com")
objIE.Visible = True
Do Until objIE.ReadyState = 4 : Call WScript.Sleep(100) : Loop
With objIE.Document
.getElementByID("user").value = "username"
.getElementByID("passwd").value = "mypass"
.getElementByID("submit").submit
End With
Explanation / Answer
Solution:
You are facing this error because the login credentials which you are sending needs to be in the form of an object.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.