NamedRange.QueryTable Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a QueryTable that represents the query table that intersects the NamedRange control.
public:
property Microsoft::Office::Interop::Excel::QueryTable ^ QueryTable { Microsoft::Office::Interop::Excel::QueryTable ^ get(); };
public Microsoft.Office.Interop.Excel.QueryTable QueryTable { get; }
member this.QueryTable : Microsoft.Office.Interop.Excel.QueryTable
Public ReadOnly Property QueryTable As QueryTable
Property Value
A QueryTable that represents the query table that intersects the NamedRange control.
Examples
The following code example uses the QueryTable property to refresh a query table that intersects a NamedRange. 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