QueryTable.Parameters Property (Excel)

Returns a Parameters collection that represents the query table parameters. Read-only.

Syntax

expression .Parameters

expression A variable that represents a QueryTable object.

Remarks

If you import data using the user interface, data from a Web query or a text query is imported as a QueryTable object, while all other external data is imported as a ListObject object.

If you import data using the object model, data from a Web query or a text query must be imported as a QueryTable, while all other external data can be imported as either a ListObject or a QueryTable.

You can use the QueryTable property of the ListObject to access the Parameters property.

Example

This example returns the Parameters collection from an existing parameter query. If the first parameter uses the character data type, the user is instructed to enter characters only in the prompt dialog box.

With Sheets("sheet1").QueryTables(1).Parameters(1) 
 If .DataType = xlParamTypeVarChar Then 
 .SetParam xlPrompt, "Enter a character only" 
 End If 
End With

See Also

Concepts

QueryTable Object

QueryTable Object Members