so by searching alot i put a code together to automatically login to a page that i want , the following code works fine with Gmail, but not with the login page that i want, my login HTML code on the form section looks like this
</SPAN>
<</SPAN>div</SPAN> id</SPAN>="divLogin"></SPAN>
<</SPAN>div</SPAN> id</SPAN>="divLoginImage"></SPAN>
<</SPAN>div</SPAN> class</SPAN>="form-background"></< SPAN>div</SPAN>></SPAN>
<</SPAN>div</SPAN> class</SPAN>="form-content"></SPAN>
<</SPAN>form</SPAN> name</SPAN>="loginForm" </SPAN>method</SPAN>="post"></SPAN>
<</SPAN>table</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN> class</SPAN>="label"></SPAN>Username</SPAN></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN>><</SPAN>input</SPAN> type</SPAN>="text" </SPAN>name</SPAN>="login_name" </SPAN>size</SPAN>="30"/></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN> class</SPAN>="label"></SPAN>Password</SPAN></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN>><</SPAN>input</SPAN> type</SPAN>="password" </SPAN>name</SPAN>="login_password" </SPAN>size</SPAN>="30" </SPAN>AUTOCOMPLETE</SPAN>="off"/></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN>><</SPAN>input</SPAN> type</SPAN>="button" </SPAN>name</SPAN>="enter" </SPAN>value</SPAN>="Login" </SPAN>class</SPAN>="button" </SPAN>*******</SPAN>="mxSubmit()"/></SPAN>
<</SPAN>br</SPAN>><</SPAN>br</SPAN>><</SPAN>br</SPAN>></SPAN>
and here is my code can you please let me know what i am doing wrong please ???? my code opens the login page and then do not do anything at all ! and then i get undefined error on excel NOTE: i am not including the link becasue it will not work outside of our company, if you can help me with this , you saved me alot !!!! please help me if you know what the problem is.. Thank you</SPAN>
</SPAN>
</SPAN>
<</SPAN>div</SPAN> id</SPAN>="divLogin"></SPAN>
<</SPAN>div</SPAN> id</SPAN>="divLoginImage"></SPAN>
<</SPAN>div</SPAN> class</SPAN>="form-background"></< SPAN>div</SPAN>></SPAN>
<</SPAN>div</SPAN> class</SPAN>="form-content"></SPAN>
<</SPAN>form</SPAN> name</SPAN>="loginForm" </SPAN>method</SPAN>="post"></SPAN>
<</SPAN>table</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN> class</SPAN>="label"></SPAN>Username</SPAN></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN>><</SPAN>input</SPAN> type</SPAN>="text" </SPAN>name</SPAN>="login_name" </SPAN>size</SPAN>="30"/></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN> class</SPAN>="label"></SPAN>Password</SPAN></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN>><</SPAN>input</SPAN> type</SPAN>="password" </SPAN>name</SPAN>="login_password" </SPAN>size</SPAN>="30" </SPAN>AUTOCOMPLETE</SPAN>="off"/></< SPAN>td</SPAN>></SPAN>
</< SPAN>tr</SPAN>></SPAN>
<</SPAN>tr</SPAN>></SPAN>
<</SPAN>td</SPAN>><</SPAN>input</SPAN> type</SPAN>="button" </SPAN>name</SPAN>="enter" </SPAN>value</SPAN>="Login" </SPAN>class</SPAN>="button" </SPAN>*******</SPAN>="mxSubmit()"/></SPAN>
<</SPAN>br</SPAN>><</SPAN>br</SPAN>><</SPAN>br</SPAN>></SPAN>
and here is my code can you please let me know what i am doing wrong please ???? my code opens the login page and then do not do anything at all ! and then i get undefined error on excel NOTE: i am not including the link becasue it will not work outside of our company, if you can help me with this , you saved me alot !!!! please help me if you know what the problem is.. Thank you</SPAN>
Code:
Private Sub Enovia_Login_Click()</SPAN>
Const cURL = "www.thatwebsitename.com" 'Enter the web address here
Const cUsername = "myusername" 'Enter your user name here
Const cPassword = "mypass!!!" 'Enter your Password here
Dim IE As InternetExplorer
Dim doc As HTMLDocument
Dim LoginForm As HTMLFormElement
Dim UserNameInputBox As HTMLInputElement
Dim PasswordInputBox As HTMLInputElement
Dim SignInButton As HTMLInputButtonElement
Dim HTMLelement As IHTMLElement
Dim qt As QueryTable
Set IE = New InternetExplorer
IE.Visible = True
IE.Navigate cURL
'Wait for initial page to load
Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
'Set doc = IE.Document
'Set doc = IE.Document.frames("divLogin").Document
'Get the only form on the page
Set LoginForm = doc.forms("0")
'Get the User Name textbox and populate it
'input name="Email" id="Email" size="18" value="" class="gaia le val" type="text"
Set UserNameInputBox = LoginForm.elements("login_name")
UserNameInputBox.Value = cUsername
'Get the password textbox and populate it
'input name="Passwd" id="Passwd" size="18" class="gaia le val" type="password"</SPAN>
Set PasswordInputBox = LoginForm.elements("login_password")
PasswordInputBox.Value = cPassword
'Get the form input button and click it
'input class="gaia le button" name="signIn" id="signIn" value="Sign in" type="submit"
Set SignInButton = LoginForm.elements("enter")
SignInButton.Click
'Wait for the new page to load
Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop</SPAN>
End Sub