Web Query for password protected web-sites

waldymar

Board Regular
Joined
Feb 19, 2009
Messages
238
hello everyone,

I am trying to import data into Excel from a webpage using the web query function; however, the webpage requires a login and password. I have the required login and password, but I cannot figure out how to make excel automatically input these into the correct fields and login in order to import the data.

Since I am trying to make all of our databases update automatically, I don't want to enter this info everyday when the macro runs.

Any suggestions?
Thanks

Vadim
 
Hello Dave,

Hello Dave,

I made progress, I am able to log in but I get message: runtime error 91 - object variable or with block variable not set

any idea what is the reason?

Sub WebLogin()
'Dim a As String
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True

.Navigate "https://weebpage"

Do Until .ReadyState = 4
DoEvents
Loop

.document.all.Item("j_username").Value = "username"
.document.all.Item("j_password").Value = "password"
.document.forms(0).submit

End With
End Sub
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello Dave3009,

Before asking my question I have to say, I have read all your posts on this subject and I would just like to say thank you, thank you, thank you.

I am still working through your suggestions to try and access some data on a website that I log into. However, before pursuing this line of investigation any further, I was intrigued by your comment "Would you be accessing some type of database that you might be better connecting directly within Excel?" Could you please elaborate on this suggestion? I am new to VBA so please excuse my ignorance.

Regards
 
Upvote 0

Forum statistics

Threads
1,223,113
Messages
6,170,171
Members
452,306
Latest member
Shaz11

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