Rollin_Again
11-18-2005, 08:06 AM
Hello All,
I have an Excel sheet that contains thousand of our customers records. Each record consists of various info such as company ID, user ID, password, etc. As part of my job I am often required to log into our company website using our customer's log in credentials to troubleshoot their orders. Currently I have to open our website login page and enter all the info manually. I am trying to automate the entire process by selecting a row of data from the Excel sheet and then using VBA to open and automatically fill in the web login form with the data contained in the current record. I am able to create and display the Internet Explorer object and populate three text fields on the web page using code but I am unable to select from 3 sets of radio buttons on the form. Each set of radio buttons represents a YES/NO answer to each of 3 statements at the bottom of the form. Can anyone help me figure out how to select the radio buttons that are required.
So far my VB code is as follows:
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate ("www.websitename.com (http://www.websitename.com/)")
While oIE.Busy: Wend
oIE.Document.Forms("passlogon").All("UserID").Value = "jsmith"
oIE.Document.Forms("passlogon").All("NodeID").Value = "M1234567"
oIE.Document.Forms("passlogon").All("Password").Value = "myPass"
Below is a small portion of the web page source code from the website showing the form name and button names. I assume the radio button names are rbFCRA, rbClaimsUse, and rbHaveConsent but I can't figure out how to set their values. If you want to see what I am talking about just go to cplink2 dot com and look at the 3 statements at the bottom of the form.
aFm=document.passlogon
if(!IsSupport())
if(!IsRBEmpty(aFm.rbFCRA, "FCRA"+SQ+"3)") )
if ( GetValue( aFm.rbFCRA )!="YES" )
SetFcraError( aFm.rbFCRA[0], "FCRA acceptance is required." );
if(!IsSupport())
if(!IsRBEmpty(aFm.rbClaimsUse, "Usage"+SQ+"1)") )
if( GetValue(aFm.rbClaimsUse)=="YES" )
if(!IsRBEmpty(aFm.rbHaveConsent, "Consent"+SQ+"2)") )
if ( GetValue(aFm.rbHaveConsent)!="YES")
SetFcraError( aFm.rbHaveConsent[0], "Please obtain written authorization from the subject consumer before attempting to place orders for claims purposes." )
if ( (aFm.NEWPASSWORD1.value.length+aFm.NEWPASSWORD2.value.length)> 0 ) {
IsBlankCheck(aFm.NEWPASSWORD1, NP );
IsBlankCheck(aFm.NEWPASSWORD2, NP+" Confirmation");
Thanks
Rollin
I have an Excel sheet that contains thousand of our customers records. Each record consists of various info such as company ID, user ID, password, etc. As part of my job I am often required to log into our company website using our customer's log in credentials to troubleshoot their orders. Currently I have to open our website login page and enter all the info manually. I am trying to automate the entire process by selecting a row of data from the Excel sheet and then using VBA to open and automatically fill in the web login form with the data contained in the current record. I am able to create and display the Internet Explorer object and populate three text fields on the web page using code but I am unable to select from 3 sets of radio buttons on the form. Each set of radio buttons represents a YES/NO answer to each of 3 statements at the bottom of the form. Can anyone help me figure out how to select the radio buttons that are required.
So far my VB code is as follows:
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate ("www.websitename.com (http://www.websitename.com/)")
While oIE.Busy: Wend
oIE.Document.Forms("passlogon").All("UserID").Value = "jsmith"
oIE.Document.Forms("passlogon").All("NodeID").Value = "M1234567"
oIE.Document.Forms("passlogon").All("Password").Value = "myPass"
Below is a small portion of the web page source code from the website showing the form name and button names. I assume the radio button names are rbFCRA, rbClaimsUse, and rbHaveConsent but I can't figure out how to set their values. If you want to see what I am talking about just go to cplink2 dot com and look at the 3 statements at the bottom of the form.
aFm=document.passlogon
if(!IsSupport())
if(!IsRBEmpty(aFm.rbFCRA, "FCRA"+SQ+"3)") )
if ( GetValue( aFm.rbFCRA )!="YES" )
SetFcraError( aFm.rbFCRA[0], "FCRA acceptance is required." );
if(!IsSupport())
if(!IsRBEmpty(aFm.rbClaimsUse, "Usage"+SQ+"1)") )
if( GetValue(aFm.rbClaimsUse)=="YES" )
if(!IsRBEmpty(aFm.rbHaveConsent, "Consent"+SQ+"2)") )
if ( GetValue(aFm.rbHaveConsent)!="YES")
SetFcraError( aFm.rbHaveConsent[0], "Please obtain written authorization from the subject consumer before attempting to place orders for claims purposes." )
if ( (aFm.NEWPASSWORD1.value.length+aFm.NEWPASSWORD2.value.length)> 0 ) {
IsBlankCheck(aFm.NEWPASSWORD1, NP );
IsBlankCheck(aFm.NEWPASSWORD2, NP+" Confirmation");
Thanks
Rollin