Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2007, 10:33 AM
Registered User
 
Join Date: Nov 2006
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
 
Old November 1st, 2007, 01:45 PM
Friend of Wrox
 
Join Date: Feb 2007
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.

 
Old November 2nd, 2007, 09:15 AM
Registered User
 
Join Date: Nov 2006
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





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 08: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.