InternetExplorer.Application using Framesets and Frames
Posted: Thu Jan 17, 2013 4:58 am
Good afternoon gentlemen,
I need to make a script that enters an URL, fills in some sign in fields, and then collects some information from there.
I've managed to make a functional script using GMail as an example, and it goes like this:
************************************************************************************************************
Set IE = CreateObject("InternetExplorer.Application")
sURL = "http://www.gmail.com"
With IE
.Navigate sURL
.Visible = True
End With
' loop while it waits for InternetExplorer to load
Do While IE.Busy
Loop
' inputboxes value are assigned to "fname" (login) and "fpwd" (password) variables
fname=InputBox("Enter your name","Userinput")
fpwd=InputBox("Enter your password", "Userinput")
Set UserN = IE.Document.getElementById("Email")
If Not UserN Is Nothing Then
' assigns the fname value to the element "Email"
UserN.Value = fname
End If
Set PW = IE.Document.getElementById("Passwd")
' password
If Not PW Is Nothing Then
' assigns the fpwd value to the element "Passwd"
PW.Value = fpwd
End If
' finds the login button and clicks on it
Set btnInput = IE.Document.getElementById("signIn")
btnInput.Click
***************************************************************************************************************
The above mentioned code works perfectly. However, I need it to work at my job's intranet.
The problem is: the intranet url with the Login and EMail is inside a specific frame, which is inside a frameset (I am completely ignorant when the subject is html and stuff like that).
When I try to use my script, I get the "Unkow Interface" error.
Does anybody know how can I handle the frames properly??
Thanks,
Ricardo Fazzio
I need to make a script that enters an URL, fills in some sign in fields, and then collects some information from there.
I've managed to make a functional script using GMail as an example, and it goes like this:
************************************************************************************************************
Set IE = CreateObject("InternetExplorer.Application")
sURL = "http://www.gmail.com"
With IE
.Navigate sURL
.Visible = True
End With
' loop while it waits for InternetExplorer to load
Do While IE.Busy
Loop
' inputboxes value are assigned to "fname" (login) and "fpwd" (password) variables
fname=InputBox("Enter your name","Userinput")
fpwd=InputBox("Enter your password", "Userinput")
Set UserN = IE.Document.getElementById("Email")
If Not UserN Is Nothing Then
' assigns the fname value to the element "Email"
UserN.Value = fname
End If
Set PW = IE.Document.getElementById("Passwd")
' password
If Not PW Is Nothing Then
' assigns the fpwd value to the element "Passwd"
PW.Value = fpwd
End If
' finds the login button and clicks on it
Set btnInput = IE.Document.getElementById("signIn")
btnInput.Click
***************************************************************************************************************
The above mentioned code works perfectly. However, I need it to work at my job's intranet.
The problem is: the intranet url with the Login and EMail is inside a specific frame, which is inside a frameset (I am completely ignorant when the subject is html and stuff like that).
When I try to use my script, I get the "Unkow Interface" error.
Does anybody know how can I handle the frames properly??
Thanks,
Ricardo Fazzio