Stonesteel
Board Regular
- Joined
- Apr 27, 2010
- Messages
- 81
Greetings!
Can anyone help me how to make a vb code that will fill up the login realm when I click a command button? A have a sample here of scenario.
1. First is I have a command button that when I click, it will direct me to the webpage.
Code:
Image:
http://img171.imageshack.us/img171/4786/activecell.jpg
When I click the command button, this will be the url that I will be directed to, url will depend on the value of ActiveCell.Value and ActiveCell.Offset(0, 1)
http://img27.imageshack.us/img27/711/activecell2.jpg
2. Now I will be on the index of the webpage which has a login realm,.
http://img822.imageshack.us/img822/9246/canopyrealm.jpg
this is the html code for the login realm.
<form action='login.cgi' method='post' id='quickform'>
<div class='menu' id='quicklogin'>
<input type='hidden' name='mac_esn' value='0a003ef96923' />
<input type='hidden' name='Session' value='0' />
Username: <input type='text' name='CanopyUsername' id='CanopyUsername' /><br/>
Password: <input type='password' name='CanopyPassword' id='CanopyPassword'/><br/>
<input type='submit' value='Login' name='login' id='loginbutton' />
<input type='hidden' value='submit' name='webguisubmit' />
</< div></< color="purple" form>
and this is the username and password that I will be using for example,
Username: sm_inst58132806 (let's say this is located at cell C2)
Password: G4p5n0Xg (let's say this is located at cell D2)
3. Now what I want is to have a code that when I click the command button:
a. will direct me to the webpage
b. automation that will fill up the login realm with given username and password
c. after filling up the realm, will automatically click the submit button and will be directed to the main index.
http://img100.imageshack.us/img100/1592/loginsuccess.jpg
hope you could help me on this, I know some of you already knew what code to use when it comes to this one.
Can anyone help me how to make a vb code that will fill up the login realm when I click a command button? A have a sample here of scenario.
1. First is I have a command button that when I click, it will direct me to the webpage.
Code:
Code:
[FONT=Courier New][COLOR=blue]Sub ip_address()[/COLOR][/FONT]
[FONT=Courier New][COLOR=blue] File = "http://" & ActiveCell.Offset(0, 1).Value & ":1080/main.cgi?mac_esn=" & ActiveCell.Value & ""[/COLOR][/FONT]
[FONT=Courier New][COLOR=blue] Call ShellExecute(0&, vbNullString, File, _[/COLOR][/FONT]
[FONT=Courier New][COLOR=blue] vbNullString, vbNullString, vbNormalFocus)[/COLOR][/FONT]
[FONT=Courier New][COLOR=blue]End Sub[/COLOR][/FONT]
Image:
http://img171.imageshack.us/img171/4786/activecell.jpg
When I click the command button, this will be the url that I will be directed to, url will depend on the value of ActiveCell.Value and ActiveCell.Offset(0, 1)
http://img27.imageshack.us/img27/711/activecell2.jpg
2. Now I will be on the index of the webpage which has a login realm,.
http://img822.imageshack.us/img822/9246/canopyrealm.jpg
this is the html code for the login realm.
<form action='login.cgi' method='post' id='quickform'>
<div class='menu' id='quicklogin'>
<input type='hidden' name='mac_esn' value='0a003ef96923' />
<input type='hidden' name='Session' value='0' />
Username: <input type='text' name='CanopyUsername' id='CanopyUsername' /><br/>
Password: <input type='password' name='CanopyPassword' id='CanopyPassword'/><br/>
<input type='submit' value='Login' name='login' id='loginbutton' />
<input type='hidden' value='submit' name='webguisubmit' />
</< div></< color="purple" form>
and this is the username and password that I will be using for example,
Username: sm_inst58132806 (let's say this is located at cell C2)
Password: G4p5n0Xg (let's say this is located at cell D2)
3. Now what I want is to have a code that when I click the command button:
a. will direct me to the webpage
b. automation that will fill up the login realm with given username and password
c. after filling up the realm, will automatically click the submit button and will be directed to the main index.
http://img100.imageshack.us/img100/1592/loginsuccess.jpg
hope you could help me on this, I know some of you already knew what code to use when it comes to this one.