G
Guest
I am trying to logon to a website from the Excel Macro, but cannot get it to
use the correct frame on the web page. There seems to be 2 main frames to
the webpage, the login and password one, that I'm trying to use, and then the
rest of the page.
Below is the code I am using, I got it from another thread in the discussion
group.
Sub Open_Website()
Set IExplorer = CreateObject("InternetExplorer.Application")
IExplorer.Visible = True
IExplorer.navigate "http://avotus/avotus/"
Do While IExplorer.Busy And Not IExplorer.ReadyState = 4:
Application.Wait (Now + TimeValue("0:00:02"))
DoEvents
Loop
With Selection
IExplorer.document.all("Login").Value = "sl704d"
IExplorer.document.all("Password").Value = "******"
IExplorer.document.forms(0).submit
End With
End Sub
It opens the webpage perfectly, but gives me an error at the With Selection
line. I have managed to save the HTML for just the login frame and I have
run the macro successfully against this, so I'm thinking that it's not
identifying the frames on the webpage right.
My HTML programming is very limited, so that's maybe my biggest problem.
Thank's in advance for any help.
use the correct frame on the web page. There seems to be 2 main frames to
the webpage, the login and password one, that I'm trying to use, and then the
rest of the page.
Below is the code I am using, I got it from another thread in the discussion
group.
Sub Open_Website()
Set IExplorer = CreateObject("InternetExplorer.Application")
IExplorer.Visible = True
IExplorer.navigate "http://avotus/avotus/"
Do While IExplorer.Busy And Not IExplorer.ReadyState = 4:
Application.Wait (Now + TimeValue("0:00:02"))
DoEvents
Loop
With Selection
IExplorer.document.all("Login").Value = "sl704d"
IExplorer.document.all("Password").Value = "******"
IExplorer.document.forms(0).submit
End With
End Sub
It opens the webpage perfectly, but gives me an error at the With Selection
line. I have managed to save the HTML for just the login frame and I have
run the macro successfully against this, so I'm thinking that it's not
identifying the frames on the webpage right.
My HTML programming is very limited, so that's maybe my biggest problem.
Thank's in advance for any help.