Article ID: 274787 - Last Review: October 6, 2011 - Revision: 5.0 How to create Web query files for use with Excel for Mac
This article was previously published under Q274787 On This PageSUMMARY
This article explains how to create Web query files for use with
Microsoft Excel for Mac.
MORE INFORMATION
Web queries allow you to query data from a specific World Wide Web, Internet, or intranet site and retrieve the information directly into a Microsoft Excel worksheet. Microsoft Excel includes some sample Web queries.
Definition of a Web Query FileA Web query file is a text file that contains from one to four lines of text. You can create Web query files in any text editor, such as SimpleText or TextEdit (with preferences set to text).Note You must save query files as text files with no formatting. Rich Text Format (RTF) files are not recognized. Web query files are saved in the following folder on your computer's hard disk:
Microsoft Office 2001:Office:Queries -or- Microsoft Office X/Office/Queries (in Mac OS X) How to Create a Web Query FileTo create a Web query file, follow these steps:
How to Use Static and Dynamic Parameters in a Web QueryIn Web queries, you can use both static and dynamic parameters. Static parameters send query data without prompting you for any values. Dynamic parameters prompt you to type one or more values when the Web query run.The syntax for parameters is as follows parameter=value string
where parameter is the name of a parameter (for example, stock) and
value string is a value.
The value string can be one of the following values: Parameter type Value string ----------------------------------------------------------- Static value1 Dynamic ["value1","Please enter the first value:"] If multiple parameters are required, separate them with an ampersand character (&). The following example illustrates the syntax:
quote1=stock1"e2=stock2
When multiple values are sent for a single parameter, separate them with a
plus sign (+). The following example illustrates the syntax:
quote1=stock1+stock2"e2=stock3+stock4
You can combine static and dynamic parameters within a single parameter
string. The following example illustrates the syntax:
quote1=stock1"e2=["stock2","Please enter the second value:"]
Examples of Web Query FilesThe following examples demonstrate the syntax used by Web query files.Note The following examples are not functional Web queries. Example 1: This example sends the value "wyut" to the Client.exe program and retrieves a value. You are not prompted to type any values. This example sends the parameter by using the GET method.
WEB
If you like, you can omit the first two lines and use the following line:
1 http://www.weylandyutani.com/cgi-bin/client.exe?quote=wyut
http://www.weylandyutani.com/cgi-bin/client.exe?quote=wyut
Note It is acceptable to omit the first two lines when you create the Web query file. You can also omit these lines for all of the examples shown in this article.
Example Two: This example sends the values "wyut" and "hypd" to the Client2.exe program, and then retrieves values. You are not prompted to type any values. This example sends the parameters by using the POST method.
WEB Example Three:1 http://www.weylandyutani.com/cgi-bin/client2.exe quote1=wyut"e2=hypd This example prompts you to type a stock symbol, sends that symbol to the Client.exe program, and retrieves a value. This examples sends the parameters by using the GET method. Note Type the third and fourth lines of this example on a single line in your text file.
WEB Example Four:1 http://www.weylandyutani.com/cgi-bin/client.exe?quote1= ["stock1","Please enter a stock symbol:"] This example sends the value "wyut" and a value that you type to the Client2.exe program, and then retrieves the values. This example sends the parameters by using the POST method.
WEB 1 http://www.weylandyutani.com/cgi-bin/client2.exe quote1=wyut"e2=["stock2","Please enter a stock symbol:"]
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top