Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Automatic login to website using Visual Basic 6

Avatar of matthew89
matthew89 asked on
ProgrammingVisual Basic Classic
2 Comments1 Solution1941 ViewsLast Modified:
I'm having problems with this code. Ive managed to get the code to automatically enter the username and password to my media server. The problem i'm having is trying to get Visual Basic 6 to automaticaly push the sign in/login button.

I get Run time Error "438"
object doesn't support this property or method.

It seems to be pointing towards the Login1_LoginButton section line 22.

Anyone have any other methods please.

Thanks,
matt

 
Public Sub LoginMediaCentre(ByVal szUserName As String, ByVal szPassword As String)
  
  Dim IE As Object
  
  Set IE = CreateObject("InternetExplorer.Application")
  
  IE.Visible = True
  
  ' Navigate to Media Server .
  IE.Navigate "http://mediaserver:49490/login.aspx?ReturnUrl=%2fdefault.aspx"
  
  ' Wait for the page to load.
  Do While IE.Busy Or IE.ReadyState <> 4
    DoEvents
  Loop
 
  ' Enter username
  IE.Document.getElementById("Login1_UserName").Value = szUserName
  ' Enter password
  IE.Document.getElementById("Login1_Password").Value = szPassword
  ' Submit the sign in.
  IE.Document.getElementById("Login1_LoginButton").Submit
  
  
  ' Destroy object.
  Set IE = Nothing

End Sub

Private Sub Form_Load()
LoginMediaCentre "mcuser", "password"
Unload Me
End Sub
ASKER CERTIFIED SOLUTION
Avatar of nffvrxqgrcfqvvc
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers