Microsoft Office Tutorials and References
In Depth Information
Communicating with a Web Server
Within a corporate network, nearly all data transfer takes place using proprietary binary
formats, ranging from transferring files to performing remote database queries. Due
primarily to security considerations, communication across the Internet has evolved to use textual
formats, the simplest being a URL, such as http://mysite.com/mywebpage.html.
To communicate with an application running on a Web server, you need to be able to
perform some processing on the server and pass information to and receive information from
The Wo rkbook object’s FollowHyperlink method can be used to communicate with a Web
server. There are a few problems with using this method, including the following:
If an error occurs during the connection, Excel will freeze.
Any data returned from the hyperlink is automatically displayed as a new workbook.
You have very little control over the communication.
There are more flexible alternatives provided by the Microsoft Internet Transfer Control,
msinet.ocx . This ActiveX control, often referred to as the ITC, is an easy-to-use wrapper for
the wininet.dll file, which provides low-level Internet-related services for the Microsoft
There are two mechanisms that can be used to send information to a Web server. You can
either include the information as part of the URL string, or you can send it as a separate
section of the HTTP request.
URL Encoding uses parameters included with the URL string by appending them to the end
of the URL. You’ve probably noticed as you surf through Web pages that after you type the
address, the address bar automatically updates to the destination URL with question marks
and equal signs, with several letters thrown into the mix. Next time, pay attention to the
character string. Upon closer examination, you’ll see that after the URL there’s a question mark
followed by param1=value & param2=value . For example, when you navigate to the MSN
Hotmail Web page, you type in the address, www.hotmail.com . However, after you press
Enter, the following result appears in the address bar:
That is certainly different from what was initially typed in, but somehow you reach the
destination Web site.
One advantage to including the parameters as part of the URL is that the URL with the
parameters can be stored as part of the user’s favorites. However, a URL is limited to 2083
characters in Internet Explorer, which in turn restricts the amount of information that can be
passed using this method.