Send Username and password to open web?

DanBurn

Registered User.
Local time
Today, 13:33
Joined
Aug 13, 2008
Messages
30
I have added a webBrowser control to one of my forms to allow people to get extra information from a sister web page.

Everytime it loads the standard domain logins popup.

Is there a way to pass the username and password to this popup through VBA?

Cheers!
 
It depends on the nature of the popup. You may be able to use Appactivate and SendKeys (see VBA help). This is not a trivial problem but can be overcome.
 
I was thinking these lines my self but after you have logged in once it doesn't come up again which would create and error.

Although it wouldn't take much to handle that error.

But is there no part of the function itself that takes the username/Password. You would think it would be something that has come up before.
Heres how im calling the web

Code:
WebBrowser6.navigate [URL="http://www.access-programmers.co.uk/forums/="http://planweb.nottscc.gov.uk/planweb355/planweb.asp?geoset=AERIAL%20PHOTOS%202007_10&mapwidth=500&easting"]URL:="[/URL]www.google.com"
 
The other option is to use the IE active x control and replace the inner html of the logon page with your own.

But you're right, just handle the error and move on if there is an error.
 
It has worked but it is a bit messy I have had to add a Timer loop in there otherwise it sends the keys too fast:

Code:
Private Sub Form_Current()
Dim T1 As Variant
Dim T2 As Variant
WebBrowser6.navigate [URL="http://www.access-programmers.co.uk/forums/="http://www.c2trafficdata.co.uk/nodes.asp?dimtype=3&reportdate=2007-05-26&enddate=2007-06-01"]URL:="http://www.c2trafficdata.co.uk/nodes.asp?dimtype=3&reportdate=2007-05-26&enddate=2007-06-01[/URL]"
T1 = Now()
T2 = DateAdd("s", 2, T1)
Do Until T2 <= T1
T1 = Now()
Loop
 
SendKeys "Myusername{tab}Mypassword{tab}~"
End Sub

If anyone has a simple method let me know.
Cheers for your help George!
 
The only thing better is to physically send the data stream to the server in raw format. That would take a knowledge of HTML/CGI and a low level programming language (like C/C++).

Glad you got it working.
 

Users who are viewing this thread

Back
Top Bottom