ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   try to log in to web site by using excel vb, but not sure the butt (https://www.excelbanter.com/excel-programming/398575-try-log-web-site-using-excel-vbulletin-but-not-sure-butt.html)

chrisho

try to log in to web site by using excel vb, but not sure the butt
 


here is the Source of the website

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN"
<HTML<HEAD
<TITLEXXX Internet Administration System - Login</TITLE</HEAD
<BODY BGCOLOR=#FDBD49
<FORM METHOD=POST ACTION="http://XXXX/XXX/XXXX"
<INPUT TYPE=HIDDEN NAME=scr VALUE="login.cgi"
<CENTER
<P<BR<P
<BBefore you can access this function, you will need to login</B
<P
<BOperator ID:</B
<INPUT TYPE="TEXT" NAME="SEC_username" Size=10 VALUE=""
<P
<BPassword:</B
<INPUT TYPE="PASSWORD" NAME="SEC_password" Size=10 VALUE=""

<P<BR<P
<INPUT TYPE="HIDDEN" NAME="scriptname" VALUE="/cgi-bin/ias.cgi"
<INPUT TYPE="HIDDEN" NAME="parameters" VALUE="scr=menu_main%2ecgi"
<INPUT TYPE="HIDDEN" NAME="SEC_usertype" VALUE="operator"

<INPUT TYPE="SUBMIT" VALUE="LOGIN"
<INPUT TYPE="RESET" VALUE="Clear"
</CENTER

</FORM

</BODY
</HTML



Sub XXXXX()

'log into XXXXXXX.XXX

Dim a, b As Variant

a = InputBox("input your UserID")
b = InputBox("input your password")
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://XXXX/XXX/XXXX"

Do While IE.Busy And Not IE.readyState = 4:
Application.Wait (Now + TimeValue("0:00:02"))
DoEvents
Loop

IE.document.all("SEC_username").Value = a
IE.document.all("SEC_password").Value = b
Set ipf = IE.document.all.Item("cmd")
ipf.Click

End Sub

not sure if I put down the right button command to click it. Anyone can help?




All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com