Parameters Property

Microsoft Excel Visual Basic

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

For more information about returning a single object from a collection, see Returning an Object from a Collection.

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