I am new to VBScripting. Sorry for any mistakes, or lack of necessary information. I will do my best to include everything I can to help you help me.
My problem is when I execute the script, I get the following error:
- Line: 22
- Char: 5
- Error: Unspecified error
- Code: 80004005
- Source: (null)
What is strange is that I had been running the same script multiple times all day without any issue. Now when I run it, the error is displayed. Nothing in the script changed. I have tried rebooting, but that seems to have done nothing.
Here is the code:
Call Main
Function Main
Dim IE
Dim pin
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
Set objShellApp = CreateObject("Shell.Application")
Set IE2 = WScript.CreateObject("InternetExplorer.Application", "IE_")
pin=inputbox("Pin: ","Enter the pin to continue","")
IE.Visible = True
IE.Navigate "https://ps.hasdk12.org/admin/pw.html"
For Each objWindow in objShellApp.Windows
If LCase(objWindow.LocationName) = LCase("PowerSchool") Then
Set IE2 = objWindow
End If
WScript.Sleep (5)
Next
With IE2.Document
.getElementByID("fieldPassword").value = "username;" + pin
.getElementByID("btnEnter").click
End With
For Each objWindow in objShellApp.Windows
If LCase(objWindow.LocationName) = LCase("Start Page") Then
Set IE2 = objWindow
End If
WScript.Sleep (5)
Next
End Function