Consulting

Results 1 to 2 of 2

Thread: Can you use vba to log on to a website?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Mentor
    Joined
    Nov 2022
    Location
    The Great Land
    Posts
    451
    Location
    I have done it.

    Did you test that code? Looks good, if you still have IE installed.

    If you know element names, code can be much simpler.

    Sample from my db:
            'open ASTM/AASHTO test standards website and pass agency username/password to the web page
            Dim oBrowser As InternetExplorer
            Set oBrowser = New InternetExplorer
            oBrowser.Silent = True
            oBrowser.Navigate "https://login.ihserc.com/login/erc?"
            oBrowser.Visible = True
            Do
                'Wait till the Browser is loaded
            Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE
            oBrowser.Document.all.Item("subAcctLoginName").Value = "username"
            oBrowser.Document.all.Item("subAcctPassword").Value = "password"
            oBrowser.Document.all.Item("Submit").Click
    Might find this of interest https://learn.microsoft.com/en-us/an...ge-through-vba
    Last edited by June7; 07-08-2025 at 07:59 PM.
    How to attach file: Reading and Posting Messages (vbaexpress.com), click Go Advanced below post edit window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •