Digita
04-08-2008, 12:30 AM
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.
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
Any suggestions?
Thanks in advance.
Regards
kp
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.
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
Any suggestions?
Thanks in advance.
Regards
kp