Name

querytables.Add(Connection, Destination, [Sql])

Synopsis

Creates a new query table and adds it to the worksheet. Returns a QueryTable object.

Argument

Description

Connection

A string or object reference identifying the source of the data.

Destination

A Range object identifying the upper-lefthand corner of the destination of the query table.

Sql

If the Connection argument is an ODBC data source, this argument is a string containing the SQL query to perform. Otherwise, including this argument either causes an error or is ignored.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.