Section 8.3.  Other approaches

Prev don't be afraid of buying books Next

8.3. Other approaches

There are several approaches to accessing Web services with Excel. The two scenarios in this chapter are just examples of what is possible. You could, for example, combine those two, using the Office Web Services toolkit with an XML Map, or using REST and manually parsing the XML result and placing the contents into the worksheet.

If you will be calling the Web service with no parameters, or with the same parameters every time, your task is simplified. You can simply create an XML map for the output from the appropriate URL and use the Refresh XML Data command on the XML submenu to refresh the data.

For example, if the Web service is designed to return current information on a fixed set of market indices, you can create a map to the URL: http://www.xignite.com/xquotes.asmx?GetIndices. This approach does not require any code to be written.

You can write an application outside Excel that retrieves information from a Web service and writes it to an XML document on the file system. This application could be run on a daily basis, for example. The map in the Excel worksheet could then be set up to retrieve data from the local document.

Finally, you can also use an XML Map in a worksheet to post an XML document to a Web service. For example a Web service could be created for accepting expense report submissions, and users could create their expense reports in Excel and submit them to the Web service for approval.

The ability to write code that is integrated with Excel means that the possibilities are almost endless. In this chapter, we used examples written in Visual Basic for Applications (VBA). However, you can also write separate applications in Visual Basic, C# or C++ that are integrated with Excel.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net