Home > Forum Home > Automating Data Analysis Tasks > Web Query: Not able to login Share

Web Query: Not able to login

Excel Help for Web Query: Not Able To Login in Automating Data Analysis Tasks


Forum TopicPost Reply Login

Web Query: Not Able To Login

Rate this:
(3/5 from 1 vote)
Confused  Hi all,

I am trying to run a web query using VBA, but not able to pass through the login screen. I am using the following code for the query. 
I am trying access the website using the URL: [http://www.inkresearch.ca/coReport/coReport.php?ticker=AN]

When I access the website thorugh a browser, first I get a login page at [http://www.inkresearch.ca/]

Once logged in, I get http://www.inkresearch.ca/myInk.php , where I enter a ticker like 'AP' to go to the desired webpage.

Can you please suggest a solution to this problem?

Thanks,
MG.

VBA Code:
Public Sub InkWeb() Dim MyPost As String
Dim MyUrl As String
Dim PostUser As String
Dim PostPassword As String
   
   
   
MyUrl = Trim(Range("A1").Value)         ' URL
PostUser = Trim(Range("A2").Value)      ' Username
PostPassword = Trim(Range("A3").Value)  ' Password
   
MyPost = PostUser & PostPassword
   
With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;" & MyUrl, Destination:=Cells(5, 1))
    .PostText = MyPost
    .BackgroundQuery = True
    .TablesOnlyFromHTML = True
    .Refresh BackgroundQuery:=False
    .SaveData = True
End With
   
End Sub
 Posted by on
 
There are currently no replies to the "Web Query: Not able to login" topic of the Excel Help Forum for Automating Data Analysis Tasks.

Post Reply

Find relevant Excel templates and add-ins for Web Query: Not able to login in the