Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.55 KB

Excel.QueryTable.Parameters.md

File metadata and controls

50 lines (30 loc) · 1.55 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
QueryTable.Parameters property (Excel)
vbaxl10.chm518093
vbaxl10.chm518093
Excel.QueryTable.Parameters
d82f0ef7-9e3a-b9e5-9b9f-d402fb7a573e
05/03/2019
medium

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 by 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 by 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.

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

[!includeSupport and feedback]