Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve website data into vba

Status
Not open for further replies.

janBRU

Programmer
Sep 30, 2011
3
BE
Hello,I'm trying to follow this faq 705-7299 ( refering to a former faq ( using Access 2007

This is about reading the url source of a web page into a textstring in vba. I'm not an expert in class modules, so I just did, as I was told in the thread, creating the classmodule etc.When I now try to run it, i.e. by putting the following code behind a button:
Private Sub Command330_Click()
Dim internet As rwInetXfer
Dim sText As String Debug.Print "HTML SOURCE-"
sText = internet.OpenUrl("End Sub

... the execution stops, with "Object variable or with block variable not set". Again, no expert here. I suspect one of two reasons: I need to set a reference library to be included in Tools/References, but I don't know which ....

or I need to
Set internet = ...something
but I don't know what. Can somebody help or suggest another way of doing this?

Many thanks
Jan
 
Dim internet As [!]New[/!] rwInetXfer

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hello PHV -- that worked, stupid me!

Many thanks.

Now I got the basics to work, I need to move to the next level -- well for me that is.

Is there a way to

- emulate a 'post' form submission with a url
- not sure how to phrase that: need the form submission to provide a user name and password (that's what i do using manual entry at internet explorer); once validated, I'm wondering how to continue sending url request to the website, that suppose the log in was successful.

Any thoughts and help, as always highly appreciated.

All the best,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top