Wrox Programmer Forums

Need to download code?

View our list of code downloads.

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

You are currently viewing the Excel 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 15th, 2007, 05:33 AM
Registered User
Join Date: Nov 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Import data from web service


I am trying to generate a report for which the data needs to imported by calling a web service. Is it possible to do that from a VBA? If not what are the alternatives for me to do it?

Thanks in advance.
Baris Istap.

Reply With Quote
  #2 (permalink)  
Old November 26th, 2007, 01:12 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

It is possible to use an IE object in Excel to open the page.

First do the following so the appropriate resource is available:
1) From the VBA window click Tools > References
2) Scroll down and check Microsoft Internet Controls
3) Click OK.

After that try this function to get the body:
Private Function RetrieveSite(sHTTP As String) As String

'Opens file at sHTTP and returns the text part of the body
  Dim ieBrowser As InternetExplorer
  Set ieBrowser = CreateObject("InternetExplorer.Application")
  ieBrowser.Navigate sHTTP
  ieBrowser.Visible = True 'set = False if you'd rather not see it open
  Do While ieBrowser.ReadyState <> READYSTATE_COMPLETE
  RetrieveSite = ieBrowser.Document.Body.innerTEXT

End Function

There is more than this available but this should get you pointed in the right direction.

I hope this helped.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Web Service Consuming another web service CraigWhitfield EJB 0 January 10th, 2008 08:38 AM
Error to Add Web Reference from a Web service jdjbarrios ASP.NET 2.0 Professional 0 July 18th, 2006 02:58 PM
Extract data from the XML result of a web service s.hendy ASP.NET 1.0 and 1.1 Basics 0 March 16th, 2006 12:27 PM
Service Oriented Web Service aldwinenriquez .NET Web Services 2 September 15th, 2005 03:25 AM
import data from web form Mitch Access VBA 8 September 4th, 2003 04:26 PM

All times are GMT -4. The time now is 04:51 PM.

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