Hey guys I have an Excel workbook that connects to a website and processes data based on the user that is using the workbook. I just found out that they are moving the website app to another company and the login is just a tad bit different. I was just notified today that they are going to move this on Friday so I am scrambling to find a solution that will work.
The following code works on the existing system however when I run this on the new system it doesn't execute the submit correctly. I get the ID and password passed into the correct inputs on the webpage but the submit part I cant get to work.
Current Code:
Current Login HTML: The objie.document.forms("Login").submit above works with the <INPUT TYPE="submit" VALUE="Log In" NAME="Login">. This all works great on the current system. However there is no input TYPE="submit" on the new login page it is a reference to an image. See below for the new form information.
HTML Code:
New Form:
HTML Code:
Does anyone know how I can trigger this input type? I have tried a number of things but it just failing to get the correct item. I would truly appreciate some help on this one guys.
Thanks,
The following code works on the existing system however when I run this on the new system it doesn't execute the submit correctly. I get the ID and password passed into the correct inputs on the webpage but the submit part I cant get to work.
Current Code:
Code:
Set objie = CreateObject("InternetExplorer.Application")
With objie
.navigate strLink
Do While .Busy: DoEvents: Loop
Do While .readyState <> 4: DoEvents: Loop
.Visible = True
End With
'Check for login screen
If objie.document.forms(0).name = "Login" Then
'Send login info
objie.document.forms("Login").User.Value = loginName
objie.document.forms("Login").password.Value = passwd
objie.document.forms("Login").submit
'Needs a small wait in order for the sendkeys to work
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
' Send Ok
SendKeys "{Enter}", True
End If
Current Login HTML: The objie.document.forms("Login").submit above works with the <INPUT TYPE="submit" VALUE="Log In" NAME="Login">. This all works great on the current system. However there is no input TYPE="submit" on the new login page it is a reference to an image. See below for the new form information.
HTML Code:
Code:
<FORM NAME=Login ACTION="/SAMLogin" METHOD="post">
<CENTER>
<SPAN CLASS="redtext"></SPAN> <SPAN CLASS="blacktext"></SPAN>
<P>
<TABLE CELLSPACING="0" CELLPADDING="5" BORDER="0">
<TR>
<TD ALIGN="right" CLASS="blacktext">
<SPAN CLASS="bluetext">* </SPAN>User ID:
</TD>
<TD ALIGN="left" CLASS="blacktext">
<input type="text" name="user" size="40" />
</TD>
</TR>
<TR>
<TD ALIGN="right" CLASS="blacktext">
<SPAN CLASS="bluetext">* </SPAN>Password:
</TD>
<TD ALIGN="left" CLASS="blacktext">
<INPUT TYPE="password" AUTOCOMPLETE="off" SIZE="10" NAME="password" onfocus="formInUse = true;">
<INPUT TYPE="hidden" NAME="request_uri" VALUE="[URL unfurl="true"]http://thewebsite.com/">[/URL]
</TD>
</TR>
<TR ALIGN="middle">
<TD COLSPAN="2" CLASS="blacktext">
<INPUT TYPE="submit" VALUE="Log In" NAME="Login">
</TD>
</TR>
</TABLE>
</CENTER>
</FORM>
New Form:
HTML Code:
Code:
<form action="/ssoHtmls/login.fcc" method = "POST">
<div id='login-message'>
<input type="hidden" value = "true" id="hidden-auth-reason"/>
</div>
<label for="email">Email Address <b>*</b></label>
<p class="input-wrapper">
<input class="txt" type="text" id="email" name="email" maxlength="100" TABINDEX="1"/>
</p>
<input type="hidden" id="USER" name="USER" >
<label for="password">Password
<a href="#" id="forgot-password-open-button">Forgot Password?</a>
</label>
<p class="input-wrapper">
<input class="txt" type="password" id="password" name="PASSWORD" maxlength="50" TABINDEX=2/>
</p>
<input class="img" type="image" src="img/btn_submit.jpg" border="0" height="30" width="88" alt="Submit >>" title="Submit >>" TABINDEX=3 name = "Submit" onClick="return CXPcheckLoginFields(this.form);" />
<input type="hidden" name="target" value="$SM$[URL unfurl="true"]http://thewebsite.com/dosomething.aspx">[/URL]
<input type="hidden" name="smauthreason" value="0"></form>
Does anyone know how I can trigger this input type? I have tried a number of things but it just failing to get the correct item. I would truly appreciate some help on this one guys.
Thanks,