Https Web Query in Excel 2007

redbaron06

New Member
Joined
Aug 6, 2010
Messages
44
Hi all,

I was wondering if anyone was has been able to create a web query using excel to pull data from a https webpage requring a login. I just threded through past inquries on the web and on the boards to no avail. Below is the current code, which fails to work. Any ideas or suggestions are greatly appreciated!

Sub GetWebData()
Dim MyPost As String
Const MyUrl As String = https://random.webpage.com/OA_HTML/AppsLocalLogin.jsp?
Const M__Id As String = "username=XXXXXX" 'Change user name here
Const M__Ida As String = "password=******" 'Change password here
Fields = M__Id & M__Ida
With ActiveSheet.QueryTables.Add(Connection:="URL;" & MyUrl, Destination:=Range("A1"))
.PostText = Fields
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top