Consulting

Results 1 to 3 of 3

Thread: Solved: Log on to a password protected website to view info

  1. #1
    VBAX Contributor
    Joined
    Apr 2006
    Posts
    144
    Location

    Solved: Log on to a password protected website to view info

    G'day,

    I'm struggling on a VBA problem and I need your help please. I'd like to automate the process of logging into a web page - https://www.investoronline.info/ and input account number and PIN. Perusal of the source code of the above web page, the login variables are: accountNumber & pin.

    After doing some googling, I modified a sample code found in

    http://www.business-spreadsheets.com/forum.asp?t=103

    The following code does not report any errors. However, it did not give me what I need either.

    [vba]Sub Login_WebQuery()
    Dim MyPost As String
    Const MyUrl As String = "http://www.investoronline.info/"
    Const PostUser As String = "accountNumber=xxxx" 'Account ID to be input here
    Const PostPassword As String = "&pin=xxxx" 'Change password here

    MyPost = PostUser & PostPassword

    With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;" & MyUrl, Destination:=Cells(1, 1))
    .PostText = MyPost
    .BackgroundQuery = True
    .TablesOnlyFromHTML = True
    .Refresh BackgroundQuery:=False
    .SaveData = True
    End With

    End Sub[/vba]

    Any suggestions?

    Thanks in advance.

    Regards


    kp
    Last edited by Digita; 04-08-2008 at 03:49 PM.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    How about this version?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Contributor
    Joined
    Apr 2006
    Posts
    144
    Location
    Hi Md

    Brilliant. Thanks for the link. Also thanks to Oorang for the magic script. I won't be anywhere without you guys.

    Regards


    kp

Posting Permissions

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