NamedRange.QueryTable 属性

定义

获取一个 QueryTable,它表示与 NamedRange 控件相交的查询表。Gets a QueryTable that represents the query table that intersects the NamedRange control.

public Microsoft.Office.Interop.Excel.QueryTable QueryTable { get; }

属性值

QueryTable

一个 QueryTable,表示与 NamedRange 控件相交的查询表。A QueryTable that represents the query table that intersects the NamedRange control.

示例

下面的代码示例使用 QueryTable 属性刷新与相交的查询表 NamedRangeThe following code example uses the QueryTable property to refresh a query table that intersects a NamedRange. 此代码示例假定工作表包含与单元格 C1 相交的查询表。This code example assumes that the worksheet contains a query table that intersects cell C1.

此示例适用于文档级自定义项。This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange queryTableRange;
private void RefreshQueryTable()
{
    queryTableRange = this.Controls.AddNamedRange(
         this.Range["C1"], "queryTableRange");
    this.queryTableRange.QueryTable.Refresh(missing);
}
Private queryTableRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub RefreshQueryTable()
    queryTableRange = Me.Controls.AddNamedRange( _
        Me.Range("C1"), "queryTableRange")
    Me.queryTableRange.QueryTable.Refresh()
End Sub

适用于