Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 1st, 2007, 10:33 AM
Registered User
 
Join Date: Nov 2006
Location: Harwell, Oxon, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting info from Internet Explorer into Access

I am not sure if this is the right place to ask the question but I would like to read information from Internet Explorer into a Microsoft Access database and have no idea how to go about it. Would anyone please be able to help by pointing me in the right direction?

My problem is as follows: Some sales figures are published on a web site. These figures are needed by my database so I can do some statistics on the data. It would be nice if I could read the data directly from the website into the database instead of having to log on, read the numbers from the web page, and type them into a form by hand.

Is this at all possible? If so, how do I achieve my goal?

Any help will be much appreciated.

Astrid Van Maanen
Reply With Quote
  #2 (permalink)  
Old November 1st, 2007, 01:45 PM
Friend of Wrox
Points: 513, Level: 8
Points: 513, Level: 8 Points: 513, Level: 8 Points: 513, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2007
Location: Davenport, IA, USA.
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

From the VBA Editor:
1) Click Tools > References
2) Place check next to Microsoft Internet Controls
3) Click Okay

The code then would resemble:
-------------------------------------------------
Private Function RetrieveSite(sSite As String) As String 'sSite you pass is the desired site. Example: HTTP:/YourSite.com

'Attempts to retreive website content and returns content
  Dim ieBrowser As InternetExplorer
  Set ieBrowser = CreateObject("InternetExplorer.Application")
  ieBrowser.Navigate sSite
  ieBrowser.Visible = True 'Remove this line if you don't want to see the browser window
  Do While ieBrowser.ReadyState <> READYSTATE_COMPLETE 'Code waits for instanciated browser instance to finish loading page
    DoEvents
  Loop
  RetrieveSite = ieBrowser.Document.Body.innerTEXT 'Return the retreived page text.
  ieBrowser.Quit

End Function
-------------------------------------------------

There is much more that can be done with the internet object but this should put you on the right track.

Hope this helped.

Reply With Quote
  #3 (permalink)  
Old November 2nd, 2007, 09:15 AM
Registered User
 
Join Date: Nov 2006
Location: Harwell, Oxon, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much for the prompt reply; it is just what I needed to get started!

Astrid Van Maanen
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I access a Web page by Internet Explorer Hoang Excel VBA 7 March 11th, 2008 04:42 AM
Internet Explorer cannot open the internet site cathiec ASP.NET 2.0 Basics 1 October 22nd, 2005 01:30 PM
Internet Explorer JelfMaria VB How-To 10 April 27th, 2005 03:58 PM
Access Internet Explorer via Excel VBA tony_813 Excel VBA 2 March 6th, 2005 07:20 PM
Internet Explorer Issue wndy26 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 23rd, 2004 11:11 PM



All times are GMT -4. The time now is 02:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.