Solved

How to send username and password to a secured website using VBA

Posted on 2006-11-29
2
655 Views
Last Modified: 2008-03-17
Dear Experts,

I'm trying to pass a username and password to a secured website using ms access.
I have tried passing the values in the URL (stURL = "Http://" & stSUser & ":" & stSPass & "@" & stURL_Root) and tried to pass the values using SendKeys while Internet Explorer has the focus.
In the first case (passing values in URL) IE returns the "Page cannot be displayed" error, while username and password are correct.
In the second case the logon dialog opens but the username is not pasted into the Dialog box :

On Error Resume Next
    Set Ie = CreateObject("InternetExplorer.Application")
        With Ie
           .Navigate stURL_Root
           .Visible = True
     End With
Sendkey stPaste 'string for userid has been copied to the clipboard

Can anybody help me with this issue?

Thanks and regards, Johan
0
Comment
Question by:jrameuwissen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 18035799
Does the website support passing the username and password in the URL? If so, you'd need to contact them to find out the exact syntax to use, but most sites that do support this use syntax like this:

http:\\www.website.com?username=scott&password=mcdaniel

or something similar.

If you're trying to "automate" the webpage and add your username and password via VBA, then the short answer is you really cannot do this. There is no way to automate a webpage, except through methods exposed by the webpage ...
0
 
LVL 85
ID: 18049553
Can I ask why a B? You haven't replied to this, and the comment I provided was pretty exact ... you might not like the answer, but the answer is correct.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question