0

I am able to login into facebook or gmail using the following script. But while using the same script to login into my company's network, i am unable to do so. Can anyone tell me what changes in username or password parameter or the form name should i change for the same?

On Error Resume Next
Const PAGE_LOADED = 4
Set objIE = CreateObject("InternetExplorer.Application")
Call objIE.Navigate("https://www.facebook.com")
objIE.Visible = True
Do Until objIE.ReadyState = PAGE_LOADED : Call WScript.Sleep(100) : Loop
objIE.Document.all.email.Value = ""
objIE.Document.all.pass.Value = ""
If Err.Number <> 0 Then
msgbox "Error: " & err.Description
End If
Call objIE.Document.all.login_form.Submit()
Set objIE = Nothing
JosefZ
  • 28,460
  • 5
  • 44
  • 83
user227668
  • 41
  • 2
  • 8
  • [Something like](http://stackoverflow.com/a/24250879/3439404) – JosefZ Feb 26 '15 at 11:47
  • It doesnt help. Does my code limit to logging in to different websites.? – user227668 Feb 26 '15 at 12:54
  • Compare your `objIE.Document.all.email.Value = ""` or `objIE.Document.all.pass.Value = ""` with respective `ie.Document.getElementById("uid").Value = "testID"` and `ie.Document.getElementById("password").Value = "testPW"` (in) code linked previously. Values `"uid"` and `"password"` supposedly might vary: take a look in your company's network login page/form source code. – JosefZ Feb 26 '15 at 13:16
  • I tried that too. I pick up the . This one works for sites like gmail or facebook. But it doesnt even populate the Username or password fields in my company's login page. Can you tell me why does it behave that way? – user227668 Feb 26 '15 at 13:36

0 Answers0